Originally posted by: SystemAdmin
[Sylvain said:]
I'm having some memory troubles in using callbacks.
I'm using Ilog Cplex 10.1 with Visual C++ Express 2008 in Release configuration.
The error I get is the following:
Windows has triggered a breakpoint in RF.exe.
This may be due to a corruption of the heap, which indicates a bug in RF.exe or any of the DLLs it has loaded.
This may also be due to the user pressing F12 while RF.exe has focus.
The output window may have more diagnostic information.
In Debug configuration I get:
Debug Assertion Failed!
Program: c:\Test\Debug\test.exe
File: f:\dd\vctools\crt_bld\self_x86\crt\src\dbgdel.cpp
Line: 52
Expression: _BLOCK_TYPE_IS_VALID(pHeap->nBlockUse)
For information on how your program can cause an assertion failure, see the Visual C++documentation on asserts
I narrowed down the problem to a BranchCallback where I create a NodeData object (subclass MyNodeData) using "new (env)" instead of "new".
NodeData* nodeData = new (env) MyNodeData();
makeBranch(vars, bounds, dirs, objestimate, nodeData);
If I simply use "new", I don't get any error but then there is a memory leak in the program...
Any ideas/suggestions ? Is Visual C++ Express 2008 the problem ? Could I use Visual C++ Express 2005 instead ? Or do I absolutely have to use Visual Studio 2005 ?
#CPLEXOptimizers#DecisionOptimization