void Emitter::SetSoundData(sound::ISoundData* data) { //FIXME error occurs in this function! SoundData* SFMLData = static_cast<SoundData*>(data); assert(pSFMLSoundSource == 0); delete pSFMLSoundSource; //FIXME error occurs at this deletion (virtual destructor used) pSFMLSoundSource = SFMLData->GetSFMLSoundData()->CreateSFMLSoundSource(); soundData.Reset(SFMLData); }