I have a special input plugin that manufactures its own reader_limited from the input reader. This works as expected. Once the class is destructed, I do what the SDK does and call reader_release_safe() on the reader. However, when I call this function, Foobar2000 then proceeds to crash. The crash bears all the hallmarks of performing a double delete.
CODE
reader_limited *rLimited;
virtual ~input_wad()
{
if(this->rLimited != NULL) this->rLimited->reader_release_safe(); /* Commenting this out makes everything fine. */
delete this->rLimited; /* Crashes here */
}
If I comment out the line that says reader_release_safe, everything works as normal. That indicates that I shouldn't be calling reader_release_safe(). However, I'm concerned that by not calling release, I'm leaking resources. Is this worry unfounded?
What's the proper procedure for creating and using a reader?
