Deleting STL heap objects across threads

Brian Dessent brian@dessent.net
Fri Aug 8 03:38:00 GMT 2008


Prakash Prabhu wrote:

> void *f(void *arg)
> {
>   std::map<int, string, std::less<int> >* kk = (std::map<int, string,
> std::less<int> >*)(kk);
>   delete kk;
> }

It looks like you're trying to delete an uninitialized pointer.  I think
you want (arg) not (kk) on the RHS above.

Brian



More information about the Libstdc++ mailing list