ide/designer/findCtx: Fixed memory corruption
authorJerome St-Louis <jerome@ecere.com>
Sun, 20 Apr 2014 01:06:09 +0000 (21:06 -0400)
committerJerome St-Louis <jerome@ecere.com>
Sun, 20 Apr 2014 01:06:09 +0000 (21:06 -0400)
- A static global variable was not being reset to null as it should and is a potential candidate for the cause of random IDE crashes
- A bad class ended up being set with 'SetThisClass'
- This could be reproduced systematically under MemoryGuard by first auto-completing an OnCompare method with a '(' inside a class,
  and then attempting to auto-complete an OnCompare method inside a struct (which does not yet work), e.g. Object3DSFormat.ec

ide/src/designer/findCtx.ec

index 51a6c1a..206f6b0 100644 (file)
@@ -1160,9 +1160,9 @@ Identifier FindCtxTree(OldList ast, int line, int charPos)
                {
                   currentClass = external._class.symbol.registered;
                   idResult = FindCtxClass(external._class, line, charPos);
+                  currentClass = null;
                   if(idResult)
                      return (idResult == (void *)-1 || idResult == (void *)-2) ? null : idResult;
-                  currentClass = null;
                }
                break;
          }