Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
catch_leak_detector.cpp
Go to the documentation of this file.
1/*
2 * Created by Martin on 12/07/2017.
3 *
4 * Distributed under the Boost Software License, Version 1.0. (See accompanying
5 * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 */
7
8 #include "catch_leak_detector.h"
10
11
12#ifdef CATCH_CONFIG_WINDOWS_CRTDBG
13#include <crtdbg.h>
14
15namespace Catch {
16
18 int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
19 flag |= _CRTDBG_LEAK_CHECK_DF;
20 flag |= _CRTDBG_ALLOC_MEM_DF;
21 _CrtSetDbgFlag(flag);
22 _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
23 _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
24 // Change this to leaking allocation's number to break there
25 _CrtSetBreakAlloc(-1);
26 }
27}
28
29#else
30
32
33#endif
34