Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

changing order at UnloadEffect, remove pointer from data structure fi…

…rst, then delete. This prevents the structure from holding an invalid pointer
  • Loading branch information...
commit a97746ed77706f234b42570bbd531ba4f2b794d7 1 parent 6bcbbe8
@armadillu armadillu authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 addons/ofxiPhone/src/SoundEngine.cpp
View
5 addons/ofxiPhone/src/SoundEngine.cpp
@@ -1083,12 +1083,11 @@ class OpenALObject
OSStatus UnloadEffect(UInt32 inEffectID)
{
- // [FIXED] SoundEngineEffect should be deleted before remove from the map
- SoundEngineEffect *theEffect = mEffectsMap->Get(inEffectID);
+ mEffectsMap->Remove(inEffectID); //remove pointer from structure first
+ SoundEngineEffect *theEffect = mEffectsMap->Get(inEffectID); //then delete
if (theEffect){
delete theEffect;
}
- mEffectsMap->Remove(inEffectID);
return 0;
}
Please sign in to comment.
Something went wrong with that request. Please try again.