![]() |
【转帖】crash with multiple instances of dwgdirec
crash with multiple instances of dwgdirect
crash with multiple instances of dwgdirect i have a com class that uses the dwgdirect libraries to read the drawing file. my class does the following in the constructor and destructor respectively: code: myclass::myclass() { .... odinitialize(&svcs); } myclass::~myclass() { .... for (all the maps that are read, pdb) { if ( !pdb.isnull() ) { pdb.release(); // dwgdirect forum says that you need to do this to avoid the // "pure virtual function call" error pdb = 0; } } ... oduninitialize(); } the above code works fine when i use one instance of the class. but with multiple instances of my class, the application crashes after the oduninitialize call for the last instance of myclass (irrespective of the number of instances i have created). please help - anything wrong with the above code?. has anyone used the dwgdirect library successfully in a scenario, like the one explained above. thanks, saroja dwgdirect does not have a reference counter or something like it to track the number of odinitialize() calls. odinitialize() / oduninitialize() take care about dwgdirect static data. odunitialize() destroys it making further work with dd impossible. sergey slezkin |
所有的时间均为北京时间。 现在的时间是 07:12 AM. |