Skip to content

Commit

Permalink
"fix" a segfault where callbacks of no longer existing objects are ca…
Browse files Browse the repository at this point in the history
…lled - but this is probably not a correct fix
  • Loading branch information
diafero committed May 10, 2014
1 parent 9c0bd11 commit 1d890aa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/PRP/Object/plSceneObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ void plSceneObject::delModifier(size_t idx) {
plKey key = fModifiers[idx];
fModifiers.erase(fModifiers.begin() + idx);

key->clearCallbacks();
if (key.isLoaded()) {
if (key->getObj()->isStub()) {
plDebug::Warning("WARNING: Removing STUB modifier from SceneObject");
Expand All @@ -153,6 +154,7 @@ void plSceneObject::delModifier(size_t idx) {
void plSceneObject::clearModifiers() {
for (size_t i = 0; i < fModifiers.size(); i++) {
plKey key = fModifiers[i];
key->clearCallbacks();
if (key.isLoaded()) {
if (key->getObj()->isStub()) {
plDebug::Warning("WARNING: Removing STUB modifier from SceneObject");
Expand Down

0 comments on commit 1d890aa

Please sign in to comment.