mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 18:43:26 +00:00
Add build option for using Visual Leak Detector for debugging memory leaks. Initial report:
- IfcConvert (no arguments): 2 leaks (140 bytes) (from OCE) - IfcConvert (acad2010_objects.ifc): 47 memory leaks (6,158 bytes) - IfcGeomServer: 2 leaks (from OCE) - IfcOpenHouse: 11,952 leaks (1,169,658 bytes)! - IfcParseExamples (acad2010_objects.ifc): 40 memory leaks (4,564 bytes)
This commit is contained in:
@@ -37,6 +37,10 @@
|
||||
|
||||
#include "../ifcgeom/IfcGeomIterator.h"
|
||||
|
||||
#if USE_VLC
|
||||
#include <vld.h>
|
||||
#endif
|
||||
|
||||
using namespace boost;
|
||||
|
||||
template <typename T>
|
||||
@@ -282,7 +286,13 @@ public:
|
||||
Bye() : Command(BYE) {};
|
||||
};
|
||||
|
||||
int main () {
|
||||
int main ()
|
||||
{
|
||||
// Memory leak debugging in MSVC debug mode
|
||||
#if defined(_MSC_VER) && defined(_DEBUG)
|
||||
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
|
||||
#endif
|
||||
|
||||
// Redirect stdout to this stream, so that involuntary
|
||||
// writes to stdout do not interfere with our protocol.
|
||||
std::ostringstream oss;
|
||||
|
||||
Reference in New Issue
Block a user