[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] STL map clear



Fredag den 29. juli 2005 02:24 skrev Rune Larsen:
> Hej alle
>
> Jeg er kommet lidt i tvivl. Jeg har et dobbelt STL map:
>
> std::map<int , std::map<int, my_class> > my_map;
>
> Bliver destructoren for my_class kaldt hvis jeg bruger
>
> my_map.clear()

Det skulle jeg mene. clear kalder erase for alle elementer. Erase kalder 
destructoren på objekterne.

Faldgruben plejer at være hvis my_class er en peger.

>
> Jeg har et memory leak som jeg ikke helt kan greje og tænkte om det var
> det.

Valgrind er sagen. valgrind.kde.org - eller som pakke til din dist. Det kan 
kun gå for langsomt ;-)

Mads

-- 
Mads Bondo Dydensborg.                               sslug@sslug
Maybe you don't care about Microsoft's victims. When Microsoft starts
charging you for every time you turn your computer on, will you care then?
                                        - Melantha Bacchae on /.



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:44 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *