Fixed memory leak

Updated Modified-Event (now only one parameter [the modified text])
This commit is contained in:
Christian Hammacher 2005-09-07 22:20:28 +00:00
parent 80048eba61
commit 7c21deb0f2
10 changed files with 155 additions and 85 deletions

View File

@ -60,30 +60,32 @@ begin
if Plugin_UpdateCodeExplorer(GetCurrLang.Name, ActiveDoc.FileName, frmMain.tsMain.Items[frmMain.tsMain.ActiveTabIndex].Caption, True) then begin
try
if (frmMain.tsMain.ActiveTabIndex = 0) then begin
// analyze code
with ParseCodePAWN(eCode, ExtractFileName(ActiveDoc.FileName)) do begin
eConstants.Assign(Constants);
eDefined.Assign(Defined);
eCVars.Assign(CVars);
eIncluded.Assign(Included);
eMethodsDefault.Assign(MethodsDefault);
eMethodsEvents.Assign(Events);
eStocks.Assign(Stocks);
eNatives.Assign(Natives);
eForwards.Assign(Forwards);
eVariables.Assign(Variables);
if Plugin_UpdateCodeExplorer(GetCurrLang.Name, ActiveDoc.FileName, frmMain.tsMain.Items[frmMain.tsMain.ActiveTabIndex].Caption, True) then begin
// analyze code
with ParseCodePAWN(eCode, ExtractFileName(ActiveDoc.FileName)) do begin
eConstants.Assign(Constants);
eDefined.Assign(Defined);
eCVars.Assign(CVars);
eIncluded.Assign(Included);
eMethodsDefault.Assign(MethodsDefault);
eMethodsEvents.Assign(Events);
eStocks.Assign(Stocks);
eNatives.Assign(Natives);
eForwards.Assign(Forwards);
eVariables.Assign(Variables);
eAutoComplete := eAutoComplete + #13 + AutoComplete.Text;
eCallTips := eCallTips + #13 + CallTips.Text;
eKeywords := eKeywords + #13 + HighlightKeywords.Text;
eAutoComplete := eAutoComplete + #13 + AutoComplete.Text;
eCallTips := eCallTips + #13 + CallTips.Text;
eKeywords := eKeywords + #13 + HighlightKeywords.Text;
DestroyResult;
DestroyResult;
end;
// apply changes
Synchronize(SetValuesPAWN);
end;
// apply changes
Synchronize(SetValuesPAWN);
end;
except
// GABEM
// GABEN
end;
end;
Sleep(1000);

View File

@ -28,21 +28,22 @@ type
TStringWrapper = class(TObject)
public
Value: string;
constructor Create(const AValue: string);
constructor Create(const AValue: string); reintroduce;
end;
TSTLWrapper = class(TObject)
public
STL: TSelectionTextList;
Value: String;
constructor Create(const ASTL: TSelectionTextList; const AValue: String);
constructor Create(const ASTL: TSelectionTextList; const AValue: String); reintroduce;
destructor Destroy; reintroduce;
end;
function AddField(eName, eCategory, eValue: String): TJvCustomInspectorItem;
function AddCombo(eName, eCategory, eValue: String; eValues: array of string): TJvCustomInspectorItem;
procedure UpdateCI;
procedure UpdateCI_PAWN;
procedure UpdateCI_Pawn;
var eFormatSettings: String;
eAllIncluded: TStringArray;
@ -211,12 +212,12 @@ begin
if not Plugin_UpdateCodeInspector(GetCurrLang.Name, ActiveDoc.FileName, frmMain.tsMain.Items[frmMain.tsMain.ActiveTabIndex].Caption, True) then exit;
if GetCurrLang.Name = 'Pawn' then begin
UpdateCI_PAWN;
UpdateCI_Pawn;
Plugin_UpdateCodeInspector(GetCurrLang.Name, ActiveDoc.FileName, frmMain.tsMain.Items[frmMain.tsMain.ActiveTabIndex].Caption, False);
end;
end;
procedure UpdateCI_PAWN;
procedure UpdateCI_Pawn;
procedure HideBracesAndStrings(var eStr: String);
begin
while Between(eStr, '{', '}') <> '' do begin
@ -393,8 +394,9 @@ begin
else
AddField('', 'No information available.', '');
end;
eStr.Free;
eBraceTexts.Free;
SetLength(eAllIncluded, 0);
eStr.Free;
end;
{ TSTLWrapper }
@ -404,6 +406,13 @@ constructor TSTLWrapper.Create(const ASTL: TSelectionTextList;
begin
STL := ASTL;
Value := AValue;
inherited Create;
end;
destructor TSTLWrapper.Destroy;
begin
STL.Free;
inherited;
end;
initialization

View File

@ -25,7 +25,7 @@ begin
Result := StringReplace(Result, #2, #13#10, [rfReplaceAll]);
end;
end;
eFile.Free;
eFile.Destroy;
end;
function GetSnippetList(Lang: String): TStringList;
@ -48,7 +48,7 @@ begin
eFile.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'config\' + Lang + '.csl'); // ... .csl = CodeSnippetList
eFile.Add(Ident + #1 + Code);
eFile.SaveToFile(ExtractFilePath(ParamStr(0)) + 'config\' + Lang + '.csl'); // ... .csl = CodeSnippetList
eFile.Free;
eFile.Destroy;
end;
procedure DelSnippet(Lang, Ident: String);
@ -62,7 +62,7 @@ begin
eFile.Delete(i);
end;
eFile.SaveToFile(ExtractFilePath(ParamStr(0)) + 'config\' + Lang + '.csl'); // ... .csl = CodeSnippetList
eFile.Free;
eFile.Destroy;
end;
procedure SetSnippet(Lang, Ident, Code: String);
@ -78,7 +78,7 @@ begin
if Pos(Ident + #1, eFile[i]) = 1 then begin
eFile[i] := Ident + #1 + Code;
eFile.SaveToFile(ExtractFilePath(ParamStr(0)) + 'config\' + Lang + '.csl'); // ... .csl = CodeSnippetList
eFile.Free;
eFile.Destroy;
exit;
end;
@ -86,7 +86,7 @@ begin
{ else... }
eFile.Add(Ident + #1 + Code);
eFile.SaveToFile(ExtractFilePath(ParamStr(0)) + 'config\' + Lang + '.csl'); // ... .csl = CodeSnippetList
eFile.Free;
eFile.Destroy;
end;
end.

View File

@ -93,7 +93,7 @@ function GetAllDirs: TStringList;
procedure SetProxySettings;
function TryConnect: Integer;
var PAWNProjects: TDocCollection;
var PawnProjects: TDocCollection;
CPPProjects: TDocCollection;
OtherProjects: TDocCollection;
@ -113,7 +113,7 @@ uses UnitfrmMain, UnitfrmSettings, UnitLanguages, UnitfrmSelectColor,
function GetCat: String;
begin
if frmMain.mnuPAWN.Checked then
if frmMain.mnuPawn.Checked then
Result := 'Pawn'
else if frmMain.mnuCPP.Checked then
Result := 'C++'
@ -286,7 +286,7 @@ begin
end;
until FindNext(eRec) <> 0;
end;
ePConfig.Free;
ePConfig.Destroy;
end;
function GetAllIncludeFiles: TStringArray;
@ -323,7 +323,7 @@ begin
for i := 0 to eStr.Count -1 do
Result[i] := eStr[i];
eStr.Free;
eStr.Destroy;
end;
@ -407,8 +407,8 @@ begin
if Started then begin
if ListenServer then
Result := frmSettings.txtAMXXDir.Text
else if Length(frmSettings.txtPAWNCompilerPath.Text) > 8 then
Result := IncludeTrailingPathDelimiter(Copy(ExtractFilePath(frmSettings.txtPAWNCompilerPath.Text), 1, Length(ExtractFilePath(frmSettings.txtPAWNCompilerPath.Text)) - 10))
else if Length(frmSettings.txtPawnCompilerPath.Text) > 8 then
Result := IncludeTrailingPathDelimiter(Copy(ExtractFilePath(frmSettings.txtPawnCompilerPath.Text), 1, Length(ExtractFilePath(frmSettings.txtPawnCompilerPath.Text)) - 10))
else
Result := '';
end
@ -420,7 +420,7 @@ function CloseDocument(eDocument: TDocument; SaveActiveDoc: Boolean = False): Bo
var Collection: TDocCollection;
begin
case frmMain.tsMain.ActiveTabIndex of
0: Collection := PAWNProjects;
0: Collection := PawnProjects;
1: Collection := CPPProjects;
else Collection := OtherProjects;
end;
@ -463,7 +463,7 @@ procedure LoadCodeSnippets(Lang: String);
var i: integer;
CSItem: TSpTBXItem;
begin
for i := frmMain.tbxCodeSnippets.Items.Count -1 downto 5 do
for i := frmMain.tbxCodeSnippets.Items.Count -1 downto 6 do
frmMain.tbxCodeSnippets.Items.Delete(i);
with GetSnippetList(Lang) do begin
@ -542,7 +542,7 @@ begin
// no save here, it saves when another tab is being activated...
case Index of
0: Collection := PAWNProjects; // PAWN
0: Collection := PawnProjects; // Pawn
1: Collection := CPPProjects; // C++
else Collection := OtherProjects; // Other
end;
@ -640,7 +640,7 @@ begin
frmSettings.lvShortcuts.Clear;
for i := 0 to frmMain.sciEditor.KeyCommands.Count - 1 do begin
KeyCommand := frmMain.sciEditor.KeyCommands.Items[i] as TSciKeyCommand;
Ident:= 'Unknown';
Ident := 'Unknown';
IntToIdent(KeyCommand.Command, Ident, Sci_KeyboardCommandMap);
if Ident <> 'No Command' then begin // Important for Control Chars, the user mustn't change the values for it...
Item := frmSettings.lvShortcuts.Items.Add;
@ -676,11 +676,11 @@ begin
SetProxySettings;
{ Compiler }
frmSettings.txtPAWNCompilerPath.Text := eConfig.ReadString('Pawn-Compiler', 'Path', '');
frmSettings.txtPAWNArgs.Text := eConfig.ReadString('Pawn-Compiler', 'Args', '');
frmSettings.txtPAWNOutput.Text := IncludeTrailingPathDelimiter(eConfig.ReadString('Pawn-Compiler', 'DefaultOutput', ''));
if frmSettings.txtPAWNOutput.Text = '\' then
frmSettings.txtPAWNOutput.Text := '';
frmSettings.txtPawnCompilerPath.Text := eConfig.ReadString('Pawn-Compiler', 'Path', '');
frmSettings.txtPawnArgs.Text := eConfig.ReadString('Pawn-Compiler', 'Args', '');
frmSettings.txtPawnOutput.Text := IncludeTrailingPathDelimiter(eConfig.ReadString('Pawn-Compiler', 'DefaultOutput', ''));
if frmSettings.txtPawnOutput.Text = '\' then
frmSettings.txtPawnOutput.Text := '';
frmSettings.txtCPPCompilerPath.Text := eConfig.ReadString('CPP-Compiler', 'Path', '');
frmSettings.txtCPPCompilerArguments.Text := eConfig.ReadString('CPP-Compiler', 'Args', '');
frmSettings.txtCPPOutput.Text := IncludeTrailingPathDelimiter(eConfig.ReadString('CPP-Compiler', 'DefaultOutput', ''));
@ -715,7 +715,7 @@ end;
procedure SelectLanguage(Lang: String);
begin
frmMain.sciEditor.LanguageManager.SelectedLanguage := Lang;
frmMain.mnuHPAWN.Checked := Lang = 'Pawn';
frmMain.mnuHPawn.Checked := Lang = 'Pawn';
frmMain.mnuHCPP.Checked := Lang = 'C++';
frmMain.mnuHHTML.Checked := Lang = 'HTML';
frmMain.mnuHSQL.Checked := Lang = 'SQL';
@ -790,8 +790,8 @@ end;
destructor TDocument.Destroy;
begin
FCode.Destroy;
inherited Destroy;
FCode.Free;
end;
function TDocument.Save: Boolean;
@ -872,7 +872,7 @@ begin
sLines.Add(sNotes);
end;
sLines.SaveToFile(ExtractFilePath(ParamStr(0)) + 'config\Notes.dat');
sLines.Free;
sLines.Destroy;
end;
FModified := False;
@ -1021,7 +1021,7 @@ var Collection: TDocCollection;
i: integer;
begin
case frmMain.tsMain.ActiveTabIndex of
0: Collection := PAWNProjects;
0: Collection := PawnProjects;
1: Collection := CPPProjects;
else Collection := OtherProjects;
end;
@ -1152,7 +1152,7 @@ begin
end;
end;
eLines.Free;
eLines.Destroy;
end;
end;
Screen.Cursor := crDefault;
@ -1275,15 +1275,15 @@ end;
initialization
PAWNProjects := TDocCollection.Create('Pawn');
PawnProjects := TDocCollection.Create('Pawn');
CPPProjects := TDocCollection.Create('C++');
OtherProjects := TDocCollection.Create('null');
CurrProjects := 0;
ActiveDoc := PAWNProjects.ActiveDocument;
ActiveDoc := PawnProjects.ActiveDocument;
finalization
PAWNProjects.Free;
PawnProjects.Free;
CPPProjects.Free;
OtherProjects.Free;

View File

@ -18,7 +18,7 @@ type TCodeSnippetClick = function (pTitle, pCategory: PChar; pCode: PChar): Inte
TCustomItemClick = function (pCaption: PChar): Integer; cdecl;
TThemeChanged = function (pTheme: PChar): Integer; cdecl;
TModified = function (pModifiedText: PChar; pText: PChar): Integer; cdecl;
TModified = function (pModifiedText: PChar): Integer; cdecl;
TKeyPress = function (pKey: PChar): Integer; cdecl;
TEditorClick = function: Integer; cdecl;
TUpdateSel = function (pSelStart, pSelLength, pFirstVisibleLine: Integer): Integer; cdecl;
@ -89,7 +89,7 @@ function Plugin_ShowHelp(HelpType: Integer): Boolean;
function Plugin_CustomItemClick(Caption: String): Boolean;
function Plugin_ThemeChange(Theme: String): Boolean;
function Plugin_Modified(Modified, Text: PChar): Boolean;
function Plugin_Modified(ModifiedStr: PAnsiChar): Boolean;
function Plugin_KeyPress(Key: Char): Boolean;
function Plugin_EditorClick(DoubleClick: Boolean): Boolean;
function Plugin_UpdateSel(SelStart, SelLength, FirstVisibleLine: Integer): Boolean;
@ -382,6 +382,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_FileLoad(Filename: String; Loading: Boolean): Boolean;
@ -408,6 +410,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_FileSave(Filename: String; Saving: Boolean): Boolean;
@ -434,6 +438,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_DocChange(Index: Integer; Filename, Highlighter: String; RestoreCaret, Changing: Boolean): Boolean;
@ -460,6 +466,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_ProjectsChange(OldIndex, NewIndex: Integer; Changing: Boolean): Boolean;
@ -486,6 +494,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_CreateNewFile(Item: Byte; Creating: Boolean): Boolean;
@ -512,6 +522,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_Search(SearchList, Selected: String; Displaying, SearchAgain: Boolean; CaseSensivity, WholeWords, SearchFromCaret, SelectedOnly, RegEx, Forward: Boolean): Boolean;
@ -540,6 +552,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_SearchReplace(Expression, Replace, ExpList, RepList: String; CaseSensivity, WholeWords, SearchFromCaret, SelectedOnly, RegEx, Forward: Boolean): Boolean;
@ -563,6 +577,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_VisibleControlChange(Control: Integer; Show: Boolean): Boolean;
@ -586,6 +602,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_Compile(CompileType: Integer; Lang, Filename: String; Compiling: Boolean): Boolean;
@ -612,6 +630,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_ShowHelp(HelpType: Integer): Boolean;
@ -635,6 +655,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_CustomItemClick(Caption: String): Boolean;
@ -658,6 +680,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_ThemeChange(Theme: String): Boolean;
@ -681,9 +705,11 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_Modified(Modified, Text: PChar): Boolean;
function Plugin_Modified(ModifiedStr: PAnsiChar): Boolean;
var Func: TModified;
i: integer;
Handles: TIntegerArray;
@ -695,7 +721,7 @@ begin
@Func := GetProcAddress(Handles[i], 'Modified');
if @Func <> nil then begin
case Func(Modified, Text) of
case Func(ModifiedStr) of
PLUGIN_HANDLED: Result := False;
PLUGIN_STOP: begin
Result := False;
@ -704,6 +730,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_KeyPress(Key: Char): Boolean;
@ -727,6 +755,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_EditorClick(DoubleClick: Boolean): Boolean;
@ -753,6 +783,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_UpdateSel(SelStart, SelLength, FirstVisibleLine: Integer): Boolean;
@ -776,6 +808,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_CallTipShow(List: PChar): Boolean;
@ -799,6 +833,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_CallTipClick(Position: Integer): Boolean;
@ -822,6 +858,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_AutoCompleteShow(List: PChar): Boolean;
@ -845,6 +883,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_AutoCompleteSelect(Text: PChar): Boolean;
@ -868,6 +908,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_AppMsg(hwnd: HWND; Message: Integer; wParam, lParam: Integer; time: Integer; pt: TPoint): Boolean;
@ -891,7 +933,9 @@ begin
end;
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_UpdateCodeExplorer(Lang, Filename, CurrProjects: String; Updating: Boolean): Boolean;
var Func: TUpdateCodeTools;
@ -917,6 +961,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_UpdateCodeInspector(Lang, Filename, CurrProjects: String; Updating: Boolean): Boolean;
@ -943,6 +989,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_OutputDblClick(ItemIndex: Integer): Boolean;
@ -966,6 +1014,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
function Plugin_OutputPopup(ItemIndex: Integer): Boolean;
@ -989,6 +1039,8 @@ begin
end;
end;
end;
SetLength(Handles, 0);
Handles := nil;
end;
end.

View File

@ -113,9 +113,7 @@ begin
eString := RemoveStringsAndComments(Trim(eCode[i]), True);
end
{ Included }
else if (IsAtStart('#include', Trim(eCode[i]), False)) then begin
eString := Trim(eCode[i]);
else if (IsAtStart('#include', eString)) then begin
if Between(eString, '<', '>') <> '' then begin
eString := Between(eString, '<', '>');
if ExtractFileExt(eString) <> '' then
@ -141,6 +139,7 @@ begin
if (eString <> '') and (FileExists(eTemp)) then begin
// Load code and parse
eTempResult := nil;
try
eStr.LoadFromFile(eTemp);
if Application.Terminated then exit;
@ -150,11 +149,11 @@ begin
Result.CallTips.AddStrings(eTempResult.CallTips);
Result.HighlightKeywords.AddStrings(eTempResult.HighlightKeywords);
// free
eTempResult.DestroyResult;
eTempResult := nil;
except
// mmmm.. burger
end;
if Assigned(eTempResult) then
eTempResult.DestroyResult;
// wait
Sleep(20);
end;
@ -166,8 +165,8 @@ begin
Result.CVars.AddObject(Between(eString, '"', '"'), TObject(i));
end
{ Defined }
else if (IsAtStart('#define', Trim(eCode[i]))) then begin
eString := Copy(Trim(eCode[i]), 8, Length(Trim(eCode[i])));
else if (IsAtStart('#define', eString)) then begin
eString := Copy(eString, 8, Length(eString));
eString := Trim(eString);
Result.CallTips.Add(eString + '-> ' + FileName);
if Pos(#32, eString) <> 0 then
@ -179,8 +178,8 @@ begin
end
{ Events (Part 1) }
else if (IsAtStart('register_event(', eString)) and (not IsRecursive) then begin
if CountChars(Trim(eCode[i]), '"') >= 4 then begin
eTemp := StringReplace(Trim(eCode[i]), '"' + Between(Trim(eCode[i]), '"', '"') + '"', '', []);
if CountChars(eString, '"') >= 4 then begin
eTemp := StringReplace(eString, '"' + Between(eString, '"', '"') + '"', '', []);
ePreEvents.Add(Between(eString, '"', '"'));
end;
end;
@ -403,4 +402,3 @@ finalization
end.

View File

@ -1,6 +1,6 @@
object frmMain: TfrmMain
Left = 237
Top = 236
Left = 224
Top = 293
Width = 888
Height = 640
Caption = 'AMXX-Studio'
@ -579,7 +579,7 @@ object frmMain: TfrmMain
object mnuCodeSnippets: TSpTBXRightAlignSpacerItem
CaptionW = 'Code-Snippets:'
end
object mnuPAWN: TSpTBXItem
object mnuPawn: TSpTBXItem
AutoCheck = True
Checked = True
OnClick = OnCodeSnippetSelect

View File

@ -114,7 +114,7 @@ type
mnuTCompile: TSpTBXItem;
tbxCodeSnippets: TSpTBXToolbar;
mnuCodeSnippets: TSpTBXRightAlignSpacerItem;
mnuPAWN: TSpTBXItem;
mnuPawn: TSpTBXItem;
mnuCPP: TSpTBXItem;
sepCodeSnippets: TSpTBXSeparatorItem;
tbxEdit: TSpTBXToolbar;
@ -639,6 +639,15 @@ begin
CopyFile(PChar(ExtractFilePath(ParamStr(0)) + 'config\Other.bak'), PChar(ExtractFilePath(ParamStr(0)) + 'config\Other.csl'), False);
end;
if mnuPawn.Checked then
LoadCodeSnippets('Pawn')
else if mnuCPP.Checked then
LoadCodeSnippets('C++')
else if mnuHTML.Checked then
LoadCodeSnippets('HTML')
else
LoadCodeSnippets('Other');
DeleteFile(ExtractFilePath(ParamStr(0)) + 'config\PAWN.bak');
DeleteFile(ExtractFilePath(ParamStr(0)) + 'config\C++.bak');
DeleteFile(ExtractFilePath(ParamStr(0)) + 'config\Other.bak');
@ -1544,7 +1553,7 @@ begin
frmClose.trvFiles.Items.AddChild(eRoot, IntToStr(i +1) + '. ' + ExtractFileName(TDocument(PAWNProjects.Items[i]).FileName));
end;
if eRoot.Count = 0 then
eRoot.Free
eRoot.Destroy
else
eRoot.Expand(False);
{ C++ Projects }
@ -1554,7 +1563,7 @@ begin
frmClose.trvFiles.Items.AddChild(eRoot, IntToStr(i +1) + '. ' + ExtractFileName(TDocument(CPPProjects.Items[i]).FileName));
end;
if eRoot.Count = 0 then
eRoot.Free
eRoot.Destroy
else
eRoot.Expand(False);
{ Other Projects }
@ -1564,7 +1573,7 @@ begin
frmClose.trvFiles.Items.AddChild(eRoot, IntToStr(i +1) + '. ' + ExtractFileName(TDocument(OtherProjects.Items[i]).FileName));
end;
if eRoot.Count = 0 then
eRoot.Free
eRoot.Destroy
else
eRoot.Expand(False);
@ -1689,7 +1698,7 @@ begin
end;
end;
eSavedFiles.SaveToFile(ExtractFilePath(ParamStr(0)) + 'config\Cache.cfg');
eSavedFiles.Free;
eSavedFiles.Destroy;
end;
procedure TfrmMain.trvExplorerDblClick(Sender: TObject);
@ -1947,7 +1956,7 @@ begin
MessageBox(Handle, PChar(lSuccessfulRegistered), PChar(Application.Title), MB_ICONINFORMATION);
end;
eStr.Free;
eStr.Destroy;
end;
end;
@ -2015,7 +2024,7 @@ begin
Screen.Cursor := crDefault;
MessageBox(Handle, PChar(lSuccessfulRegistered), PChar(Application.Title), MB_ICONINFORMATION);
end;
eStr.Free;
eStr.Destroy;
try
IdFTP.TransferType := ftASCII;
@ -2058,7 +2067,7 @@ begin
for i := 0 to eStr.Count -1 do
eStr[i] := '"' + eStr[i] + '\n" +';
frmMOTDGen.txtMOTD.Lines.Assign(eStr);
eStr.Free;
eStr.Destroy;
frmMOTDGen.ShowModal;
end
@ -2242,7 +2251,7 @@ procedure TfrmMain.sciEditorModified(Sender: TObject; const position,
foldLevelNow, foldLevelPrev: Integer);
begin
if Started then
Plugin_Modified(text, sciEditor.Lines.GetText);
Plugin_Modified(text);
end;
procedure TfrmMain.sciEditorDblClick(Sender: TObject);
@ -2426,7 +2435,7 @@ begin
Msg.Result := ilImages.Add(eBMP, nil)
else
Msg.Result := ilImages.AddMasked(eBMP, eIntData);
eBMP.Free;
eBMP.Destroy;
end;
SCM_MENU_ADDITEM: begin
if Pos('->', eData) <> 0 then begin
@ -2538,7 +2547,7 @@ begin
AddField(eStr[0], eStr[1], eStr[2])
else
Msg.Result := 0;
eStr.Free;
eStr.Destroy;
end;
SCM_CODEINSPECTOR_ADDCOMBO: begin
eStr := TStringList.Create;
@ -2551,7 +2560,7 @@ begin
end
else
Msg.Result := 0;
eStr.Free;
eStr.Destroy;
end;
SCM_CODEINSPECTOR_SETVALUE: begin
eStr := TStringList.Create;

View File

@ -59,7 +59,7 @@ object frmSettings: TfrmSettings
Top = 0
Width = 353
Height = 260
ActivePage = jspShortcuts
ActivePage = jspHighlighter
PropagateEnable = False
Align = alClient
OnChange = jplSettingsChange

View File

@ -765,7 +765,7 @@ begin
end;
if trvDirectories.Items.Count <> 0 then
trvDirectories.Items.Item[0].Expand(True);
eStr.Free;
eStr.Destroy;
// ... scan for directories ...
with GetAllDirs do begin