This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Deleting STL heap objects across threads


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]