|
|
|
|
|
|
==21415== 918 bytes in 54 blocks are definitely lost in loss record 387 of 406 ==21415== at 0x402569A: operator new(unsigned int) (vg_replace_malloc.c:255) ==21415== by 0x469FD05: std::string::_Rep::_S_create(unsigned int, unsigned int, std::allocator<char> const&) (in /usr/lib/libstdc++.so.6.0.13) ==21415== by 0x46A0E30: ??? (in /usr/lib/libstdc++.so.6.0.13) ==21415== by 0x46A10A1: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&, unsigned int, unsigned int) (in /usr/lib/libstdc++.so.6.0.13) ==21415== by 0x805DC36: evaluate(std::string, LocalSet*) (basic_string.h:2006) ==21415== by 0x805BDB0: parseStatement(std::string, LocalSet*) (parser.cpp:471) ==21415== by 0x805CCBB: evaluateFunction(std::string, LocalSet*) (parser.cpp:346) ==21415== by 0x805DB0C: evaluate(std::string, LocalSet*) (parser.cpp:221) ==21415== by 0x805BDB0: parseStatement(std::string, LocalSet*) (parser.cpp:471) ==21415== by 0x805C540: parseIfStructure(std::string, LocalSet*) (parser.cpp:402) ==21415== by 0x805EFF2: runCode(std::string, LocalSet*) (parser.cpp:43) ==21415== by 0x805FD97: TutorialApplication::update() (TutorialApplication.cpp:58) ==21415== by 0x80517A9: OgreManager::frameRenderingQueued(Ogre::FrameEvent const&) (BaseApplication.cpp:249) ==21415== by 0x4368681: Ogre::Root::_fireFrameRenderingQueued(Ogre::FrameEvent&) (OgreRoot.cpp:829) ==21415== by 0x436956F: Ogre::Root::_fireFrameRenderingQueued() (OgreRoot.cpp:884) ==21415== by 0x43695B4: Ogre::Root::_updateAllRenderTargets() (OgreRoot.cpp:1388) ==21415== by 0x436970F: Ogre::Root::renderOneFrame() (OgreRoot.cpp:966) ==21415== by 0x436977C: Ogre::Root::startRendering() (OgreRoot.cpp:956) ==21415== by 0x8051B52: OgreManager::go() (BaseApplication.cpp:197) ==21415== by 0x805FC94: main (TutorialApplication.cpp:89) |
|
|
|
|
Variable : vPtr : Foo() Deleting : vPtr : ~Foo() Variable2 : v2Ptr : Foo() Deleting : v2Ptr : |
|
|
|
|
guillaumequest wrote: |
---|
What does the compiler do when you delete a void pointer ? |
standard wrote: |
---|
In the first alternative (delete object), if the static type of the operand is different from its dynamic type, the static type shall be a base class of the operand’s dynamic type and the static type shall have a virtual destructor or the behavior is undefined. In the second alternative (delete array) if the dynamic type of the object to be deleted differs from its static type, the behavior is undefined.73) ... 73) This implies that an object cannot be deleted using a pointer of type void* because there are no objects of type void. |
guillaumequest wrote: |
---|
Do you think it would be possible to create a collection that would accept any pointer while keeping its type ? |