From 7176a815bb18c8b78587fec99c110899d736a7d1 Mon Sep 17 00:00:00 2001 From: Jonathan Barnard Date: Thu, 26 Nov 2009 05:58:34 +0000 Subject: [PATCH] UnitCommandLine: Replace Halt with Application.Terminate to fix a memory leak. --- Functions/CommandLine/UnitCommandLine.pas | 11 ++++++----- WineLauncher.lpr | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Functions/CommandLine/UnitCommandLine.pas b/Functions/CommandLine/UnitCommandLine.pas index 7edc4ad..ddbf722 100644 --- a/Functions/CommandLine/UnitCommandLine.pas +++ b/Functions/CommandLine/UnitCommandLine.pas @@ -23,18 +23,19 @@ interface uses Classes, SysUtils, Forms; -procedure ProcessCommandLineInput(); +procedure ProcessCommandLineInput; implementation uses UnitInitialization; -procedure ProcessCommandLineInput(); +procedure ProcessCommandLineInput; begin if Application.HasOption('h','help') then begin Writeln('Help your self.'); - Halt; + Application.Terminate; + exit; end; if Application.HasOption('v','version') then @@ -42,9 +43,9 @@ begin Writeln('WineLauncher: ' + WineLauncherVersion); Writeln(BuiltWithLazarusVersion); Writeln(BuiltWithFpcVersion); - Halt; + Application.Terminate; + exit; end; - end; end. diff --git a/WineLauncher.lpr b/WineLauncher.lpr index 123b9b5..c6183da 100644 --- a/WineLauncher.lpr +++ b/WineLauncher.lpr @@ -45,7 +45,8 @@ begin exit; end; - ProcessCommandLineInput(); +ProcessCommandLineInput; +if Application.Terminated then exit; {PreGUI Initialize.} if StartUp() = false then -- 2.11.4.GIT