Explorar o código

libobs: Remove duplicate debug symbol paths in Windows

kyle %!s(int64=2) %!d(string=hai) anos
pai
achega
40ed16637c
Modificáronse 1 ficheiros con 12 adicións e 9 borrados
  1. 12 9
      libobs/obs-windows.c

+ 12 - 9
libobs/obs-windows.c

@@ -1197,18 +1197,21 @@ void reset_win32_symbol_paths(void)
 
 		*path_end = 0;
 
-		for (size_t i = 0; i < paths.num; i++) {
-			const char *existing_path = paths.array[i];
-			if (astrcmpi(path.array, existing_path) == 0) {
-				found = true;
-				break;
+		abspath = os_get_abs_path_ptr(path.array);
+		if (abspath) {
+			for (size_t i = 0; i < paths.num; i++) {
+				const char *existing_path = paths.array[i];
+				if (astrcmpi(abspath, existing_path) == 0) {
+					found = true;
+					break;
+				}
 			}
-		}
 
-		if (!found) {
-			abspath = os_get_abs_path_ptr(path.array);
-			if (abspath)
+			if (!found) {
 				da_push_back(paths, &abspath);
+			} else {
+				bfree(abspath);
+			}
 		}
 
 		dstr_free(&path);