Browse Source

+ DoneReservedWords to avoid memory leaks
* TMessageItem Module field was not disposed

pierre 26 years ago
parent
commit
a415c0d2df
1 changed files with 19 additions and 3 deletions
  1. 19 3
      ide/text/fpviews.pas

+ 19 - 3
ide/text/fpviews.pas

@@ -300,6 +300,7 @@ procedure DisposeTabDef(P: PTabDef);
 
 
 function  GetEditorCurWord(Editor: PEditor): string;
 function  GetEditorCurWord(Editor: PEditor): string;
 procedure InitReservedWords;
 procedure InitReservedWords;
+procedure DoneReservedWords;
 
 
 procedure TranslateMouseClick(View: PView; var Event: TEvent);
 procedure TranslateMouseClick(View: PView; var Event: TEvent);
 
 
@@ -332,7 +333,7 @@ implementation
 
 
 uses
 uses
   Keyboard,Memory,MsgBox,Validate,
   Keyboard,Memory,MsgBox,Validate,
-  Tokens,FPSwitch,FPSymbol,
+  Tokens,FPSwitch,FPSymbol,FPDebug,
   FPVars,FPUtils,FPHelp,FPCompile;
   FPVars,FPUtils,FPHelp,FPCompile;
 
 
 const
 const
@@ -551,6 +552,12 @@ begin
     end;
     end;
 end;
 end;
 
 
+procedure DoneReservedWords;
+begin
+  if assigned(ReservedWords) then
+    dispose(ReservedWords,done);
+end;
+
 function IsFPReservedWord(S: string): boolean;
 function IsFPReservedWord(S: string): boolean;
 var _Is: boolean;
 var _Is: boolean;
     Idx: integer;
     Idx: integer;
@@ -2283,7 +2290,9 @@ constructor TMessageItem.Init(AClass: longint; AText, AModule: string; AID: long
 begin
 begin
   inherited Init;
   inherited Init;
   TClass:=AClass;
   TClass:=AClass;
-  Text:=NewStr(AText); Module:=NewStr(AModule); ID:=AID;
+  Text:=NewStr(AText);
+  Module:=NewStr(AModule);
+  ID:=AID;
 end;
 end;
 
 
 function TMessageItem.GetText(MaxLen: integer): string;
 function TMessageItem.GetText(MaxLen: integer): string;
@@ -2307,6 +2316,7 @@ destructor TMessageItem.Done;
 begin
 begin
   inherited Done;
   inherited Done;
   if Text<>nil then DisposeStr(Text);
   if Text<>nil then DisposeStr(Text);
+  if Module<>nil then DisposeStr(Module);
 end;
 end;
 
 
 function TCompilerMessage.GetText(MaxLen: Integer): String;
 function TCompilerMessage.GetText(MaxLen: Integer): String;
@@ -2959,6 +2969,8 @@ begin
        end;
        end;
     W^.HelpCtx:=hcSourceWindow;
     W^.HelpCtx:=hcSourceWindow;
     Desktop^.Insert(W);
     Desktop^.Insert(W);
+    If assigned(BreakpointCollection) then
+      BreakPointCollection^.ShowBreakpoints(W);
     Message(Application,evBroadcast,cmUpdate,nil);
     Message(Application,evBroadcast,cmUpdate,nil);
   end;
   end;
   PopStatus;
   PopStatus;
@@ -3076,7 +3088,11 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.9  1999-02-05 12:12:02  pierre
+  Revision 1.10  1999-02-10 09:42:52  pierre
+    + DoneReservedWords to avoid memory leaks
+    * TMessageItem Module field was not disposed
+
+  Revision 1.9  1999/02/05 12:12:02  pierre
     + SourceDir that stores directories for sources that the
     + SourceDir that stores directories for sources that the
       compiler should not know about
       compiler should not know about
       Automatically asked for addition when a new file that
       Automatically asked for addition when a new file that