I tried using shared_ptr, but a SIGABORT is raised during the destruction of LoopingSound when shared_ptr tries to release the Sample*.