几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】not a problem - just a hin (http://www.dimcax.com/hust/showthread.php?t=17348)

yang686526 2009-05-06 06:38 PM

【转帖】not a problem - just a hin
 
not a problem - just a hint
not a problem - just a hint
hi opendwgs,
as i seen, the oddbhostappprogressmeter - interface has
no virtual dtor and is not a child of an interface with a virtual dtor.
i think this is not good, because i have ever to dynamic cast.
can be it is by design, or it was forgotten.
in my sample the dtor of cprogressometerproc is never called,
until i dynamic cast your pointer
a sample:
class cprogessometer : public oddbhostappprogressmeter
{
public:
virtual ~cprogessometerproc()
{
is never called here
}
....
virtual void setlimit(int max) {;}
virtual void start(const char* displaystring = 0) {;}
virtual void meterprogress() {;}
virtual void stop() {;}
};
//---------------------------------------------------------------------------
class cmyodaservices : public exsystemservices, public exhostappservices
{
public:
void addref() {}
void release() {}
virtual oddbhostappprogressmeter* newprogressmeter()
{
return new cprogressometer();
}
virtual void releaseprogressmeter(oddbhostappprogressmeter* pprogressmeter)
{
delete dynamic_cast<cprogessometer*>(pprogressmeter);
}
michael
yes, probably it was forgotten, thank you.
vladimir


所有的时间均为北京时间。 现在的时间是 05:22 PM.