Re: How does STL map deal with scoping and memory persistance



Tommo wrote:
Being that I am holding pointers ( that have been new'd elsewhere )
when i want to remove elements from this map, should i be deleting the
value under a key or will the container take are of it for me??

If you allocated the memory, you need to take care of destroying it (unless you've explicitly passed on the responsibility for deleting it, e.g. to a smart pointer). The map only takes care of memory and objects it allocates. So, you should be deleting the value or, ideally, you should be using a smart pointer rather than a raw pointer.


Tom
.



Relevant Pages

  • Problems Running ConnectComputer from XP - runonce key
    ... I was able to back out and put this computer back on the workgroup, but now I'm trying to figure out why the migration failed. ... CProfileList::CProfileList() - added to the profile dir map ... CWizard::DeleteCSAllUsers-- deleting ...
    (microsoft.public.windows.server.sbs)
  • Re: em(4) VLAN + PROMISC still doesnt work with latest CVS version
    ... Iasen Kostov wrote: ... Could you try deleting ... Now it is the second one only dates differs. ...
    (freebsd-net)
  • Re: How does STL map deal with scoping and memory persistance
    ... Being that I am holding pointers ... when i want to remove elements from this map, should i be deleting the ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vc)
  • Right click in explorer
    ... copying, deleting or asking for the properties of the map. ... The instruction at 0x773d6983 referenced memory at 0x02ca0bfx. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Error code 80246005
    ... just stopping and starting the Automatic Update service (without ... deleting the container contents in between) fixed it (or at least it ... buying a new computer *8) etc... ...
    (microsoft.public.windowsupdate)