C++ delete operator results in "User breakpoint called called...." (int 3)
633562May 20 2008 — edited May 21 2008Hi All-
I'm declaring pointers to DbEnv and Db and using new and delete. The delete call results in the following message.
"User breakpoint called from code at 0x7c901230".
There is an "int 3" at the address 0x7c901230
I'm using Visual C++ 6.0 on Win XP Prof.
Here is the code...
DbEnv* pDbEnv = new DbEnv(0);
pDbEnv->open(........);
Db* pdbWK = new Db(pDbEnv, 0);
pdbWK->open(NULL, // Transaction pointer
"myDb", // Database file name
NULL, // Optional logical database name
DB_BTREE, // Database access method
DB_CREATE|DB_AUTO_COMMIT, // Open flags
0); // File mode (using de
// use db
// close db
pdbWK->close(0);
delete pdbWK; // Errant line
I get the above mentioned message ("User breakpoint called from code at 0x7c901230") when delete pdbWk is executed.
I was thinking if the Db::close() tries to do a "delete this;", but this wouldn't make sense since Db can also be declared on the stack.
I tried to find the src file for Db::close() but couldn't find it. Any help would be greatly appreciated.