From 630c7eb1ee83897a55f00bce719cfde62a5a5124 Mon Sep 17 00:00:00 2001 From: "wrenczes@gmail.com" Date: Sun, 10 Apr 2011 15:29:00 +0000 Subject: [PATCH] Per the conversation in r3388, adding an extra seatbelt to ensure that if an object is removed from ActionLayer, it doesn't leave a dangling pointer in mReactions. This should normally be a no-op, as the expectation is that mReactions is usually empty at this point. --- projects/mtg/src/ActionLayer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/mtg/src/ActionLayer.cpp b/projects/mtg/src/ActionLayer.cpp index 50c664f12..0097115fa 100644 --- a/projects/mtg/src/ActionLayer.cpp +++ b/projects/mtg/src/ActionLayer.cpp @@ -20,6 +20,7 @@ MTGAbility* ActionLayer::getAbility(int type) int ActionLayer::moveToGarbage(ActionElement * e) { + mReactions.erase(e); int i = getIndexOf(e); if (i != -1) {