This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Deleting STL heap objects across threads
- From: Brian Dessent <brian at dessent dot net>
- To: Prakash Prabhu <prakash dot prabhu at gmail dot com>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Thu, 07 Aug 2008 20:37:53 -0700
- Subject: Re: Deleting STL heap objects across threads
- References: <85a4cc050808072027q6ef70015nc55f2f459ae8ddb4@mail.gmail.com>
- Reply-to: libstdc++ at gcc dot gnu dot org
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