File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed
Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -558,6 +558,11 @@ static void git_win32_leakcheck_global_shutdown(void)
558558 git_win32_leakcheck_stack_cleanup ();
559559}
560560
561+ bool git_win32_leakcheck_has_leaks (void )
562+ {
563+ return (g_transient_count_total_leaks > 0 );
564+ }
565+
561566int git_win32_leakcheck_global_init (void )
562567{
563568 git_win32_leakcheck_stacktrace_init ();
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ int git_win32_leakcheck_global_init(void);
2121#include "git2/errors.h"
2222#include "strnlen.h"
2323
24+ bool git_win32_leakcheck_has_leaks (void );
25+
2426/* Stack frames (for stack tracing, below) */
2527
2628/**
Original file line number Diff line number Diff line change 11#include "clar_libgit2.h"
22#include "clar_libgit2_trace.h"
33
4+ #ifdef GIT_WIN32_LEAKCHECK
5+ # include "win32/w32_leakcheck.h"
6+ #endif
7+
48#ifdef _WIN32
59int __cdecl main (int argc , char * argv [])
610#else
@@ -29,6 +33,11 @@ int main(int argc, char *argv[])
2933 cl_global_trace_disable ();
3034 git_libgit2_shutdown ();
3135
36+ #ifdef GIT_WIN32_LEAKCHECK
37+ if (git_win32_leakcheck_has_leaks ())
38+ res = res || 1 ;
39+ #endif
40+
3241 at_exit_cmd = getenv ("CLAR_AT_EXIT" );
3342 if (at_exit_cmd != NULL ) {
3443 int at_exit = system (at_exit_cmd );
You can’t perform that action at this time.
0 commit comments