Skip to content

Commit

Permalink
fixed Alt-RightClick memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
BazzaCuda committed Apr 26, 2023
1 parent 8298deb commit ff48af6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions CustomMenu.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@
<DCC_Define>UNICODE;$(DCC_Define)</DCC_Define>
<VerInfo_MajorVer>0</VerInfo_MajorVer>
<VerInfo_MinorVer>9</VerInfo_MinorVer>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=0.9.3.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=0.9.3.0;Comments=</VerInfo_Keys>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=0.9.4.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=0.9.4.0;Comments=</VerInfo_Keys>
<PostBuildEvent><![CDATA[copy $(OUTPUTPATH) $(PROJECTDIR)\SampleMenu\
:: copy $(OUTPUTPATH) F:\
$(PostBuildEvent)]]></PostBuildEvent>
<VerInfo_Release>3</VerInfo_Release>
<VerInfo_Release>4</VerInfo_Release>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
Expand Down Expand Up @@ -207,19 +207,19 @@ $(PostBuildEvent)]]></PostBuildEvent>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="Win64\Debug\CustomMenu.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win64">
<RemoteName>CustomMenu.exe</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="menu.png" Configuration="Release" Class="UWP_DelphiLogo44">
<Platform Name="Win32">
<RemoteDir>Assets\</RemoteDir>
<RemoteName>Logo44x44.png</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="Win64\Debug\CustomMenu.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win64">
<RemoteName>CustomMenu.exe</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="Win32\Debug\CustomMenu.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>CustomMenu.exe</RemoteName>
Expand Down
Binary file modified CustomMenu.res
Binary file not shown.
2 changes: 1 addition & 1 deletion FormCustomMenu.pas
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ function buildMenuFromINI(iniFilePath: string; itemData: TList<TItemData>; subMe
end;

begin
case GREFRESH of TRUE: iniFile := NIL; end; // user did Alt-RightClick on desktop to force reload of the ini file
case GREFRESH and (iniFile <> NIL) of TRUE: begin iniFile.free; iniFile := NIL; end;end; // user did Alt-RightClick on desktop to force reload of the ini file
case (iniFile = NIL) and (not fileExists(iniFilePath)) of TRUE: begin result := FALSE; EXIT; end;end;
case iniFile = NIL of TRUE: iniFile := TStringList.create; end;
subMenuName := lowerCase(subMenuName); // so that subMenuName comparison isn't case sensitive
Expand Down

0 comments on commit ff48af6

Please sign in to comment.