oduninitialize() in mfc crash
oduninitialize() in mfc crash
simple mfc application in msvc8.0 keeps crashing after oduninitialize() command.
wout this one an memory leaks detected. ddwg v.2.0.3.
debugging shows this happening inside refcountertype operator -- () when srvcs is going out of scope (after oduninitialize() command).
commenting out oduninitialize() is giving memory leak on app exit.
could somebody help, please, to figure out what other object cleaning i'm missing.
fragment seats on clickbutton event and is odcopyex example analog:
code:
class myservices : public exsystemservices, public exhostappservices
{
protected:
odrx_using_heap_operators(exsystemservices);
};
// caboutdlg dialog used for app about
void cddtestdlg:

nbnclickedbuttonempty()
{
odstaticrxobject<myservices> svcs;
odinitialize(&svcs);
oddbdatabaseptr pdb = svcs.createdatabase(); // all default values
odstring outfile("c:\\dummy.dwg");
odrxobjectimpl<odwrfilebuf> fb;
fb.open(outfile.c_str());
pdb->writefile(&fb, oddb::kdwg, oddb::vac15, false /* generate bitmap */);
oduninitialize();
}
life would be so much easier if we could just look at the source codefff">fff">
last edited by gok; 2nd october 2006 at 07:39 pmfff">.
destroy database before calling oduninitialize();
vladimir
not sure how to do that (isnt it a job for smart pointer?),
pdb->release() is giving the same error message.
with odamfcapp style i moved oduninitialize() down to dlg destroy stage and it works this way:
code:
void cddtestdlg:

ndestroy()
{
cdialog:

ndestroy();
:

duninitialize();
}
life would be so much easier if we could just look at the source codefff">fff">