source: osgVisual/include/core/leakDetection.h @ 101

Last change on this file since 101 was 88, checked in by Torben Dannhauer, 14 years ago

Moved memory leak detection from source file to headerfile. Its still in the class but at least not in the source file.

The leak detection works, but the false positives are not stopped.
Use Linux/Valgrind? to make your final leak detection beyond the easy first approach in MSVC

File size: 1.2 KB
RevLine 
[86]1/* -*-c++-*- osgVisual - Copyright (C) 2009-2010 Torben Dannhauer
2 *
3 * This library is based on OpenSceneGraph, open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version.  The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * osgVisual requires for some proprietary modules a license from the correspondig manufacturer.
9 * You have to aquire licenses for all used proprietary modules.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * OpenSceneGraph Public License for more details.
15*/
16
17// Basic ideas for memory leak debugging:
18// http://weseetips.com/2008/06/17/how-to-detect-memory-leaks-by-using-crt/
19// http://stackoverflow.com/questions/532917/dealing-with-incorrect-memory-leak-reports-on-windows
20// http://msdn.microsoft.com/en-us/library/x98tx3cf.aspx
21
22#ifdef _DEBUG
[87]23        #ifdef WIN32
24                #ifndef DBG_NEW
25                        #define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ )
26                        #define new DBG_NEW
27                #endif
[86]28        #endif
[88]29#endif
Note: See TracBrowser for help on using the repository browser.