Re: inhibit compiler warning C4624 for a class hierarchy



Hi rbv,
The undefined behavior means that the behavior is decided by the compiler.
Different compilers may cause different behaviors. C++ standard does not
define a consistent behavior for this situation.

For your four requirements, I am afraid that it is hard to implement unless
you do some changes. Even if you use template allocator/deallocator, your
none-virtual Destroy method is defined in your base class OpNotification
and it uses "delete this". This only release your base instance space,
however if your derived class instance includes additional data members,
this may cause memory leak due to some left spaces not released.

Why do not you use a macro for releasing your object? It might be the least
work in your situation.
For example:
#define __ReleaseB(pB) \
delete pB;\
pB=NULL;

Hope this helps! Please feel free to let us know if you have any other
questions or concerns.

Sincerely yours,
Charles Wang
Microsoft Online Community Support

======================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================











.



Relevant Pages

  • Re: cc65 and "Hello World"
    ... For a compiler project I cannot see this. ... The development and testing of libraries and library routines is ... releasing them for download then they have not used what I put online. ... Also if anyone thinks this Aztec C stuff that I talk about is native ...
    (comp.sys.apple2.programmer)
  • Re: cc65 and "Hello World"
    ... For a compiler project I cannot see this. ... The development and testing of libraries and library routines is ... releasing them for download then they have not used what I put online. ... Also if anyone thinks this Aztec C stuff that I talk about is native ...
    (comp.sys.apple2.programmer)
  • Re: cc65 and "Hello World"
    ... compiler, assembler, linker, and library manager. ... Change management starts at the top. ... releasing them for download then they have not used what I put online. ... Also if anyone thinks this Aztec C stuff that I talk about is native ...
    (comp.sys.apple2.programmer)
  • Shed Skin under Windows and OSX
    ... I read in your blog that you would be releasing a windows ... > intaller soon. ... Boehm garbage collector and a C++ compiler, ...
    (comp.lang.python)
  • Re: Python/Wx dot net
    ... My guess (being a borland customer) is that the answer is what your ... compiler vendor gives you. ... Borland is releasing a product soon that ... .net programs. ...
    (comp.lang.python)