http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60371
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- This sounds like there is a copy constructor happening and you don't have a copy constructor defined so it is a direct assignment which means you will get a double free.