Skip to content

Commit 4a0dcee

Browse files
committed
Make the Windows leak detection more robust
This change: * Increases MY_ROW_LIMIT to 2M, since it has been failing in libgit2#5595's tests since it's _super_ close to the limit. * Calls `git_repository_free()` on a `git_repository` that was being leaked only in Windows. * Marks the global `git_repository` on `tests/repo/init.c` as `NULL` after being freed to make any accidental access more noisy. * Uses `cl_assert_equal_i()` in `test_trace_windows_stacktrace__leaks` to make the test failures more actionable. * Renames the globals in `tests/repo/init.c` so that they don't start with an underscore.
1 parent 2e5f27c commit 4a0dcee

File tree

3 files changed

+102
-94
lines changed

3 files changed

+102
-94
lines changed

src/win32/w32_crtdbg_stacktrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static CRITICAL_SECTION g_crtdbg_stacktrace_cs;
5757
* it and try again.
5858
*/
5959

60-
#define MY_ROW_LIMIT (1024 * 1024)
60+
#define MY_ROW_LIMIT (2 * 1024 * 1024)
6161
static git_win32__crtdbg_stacktrace__row g_cs_rows[MY_ROW_LIMIT];
6262
static git_win32__crtdbg_stacktrace__row *g_cs_index[MY_ROW_LIMIT];
6363

0 commit comments

Comments
 (0)