Преглед на файлове

* Free memory in finalization section.

git-svn-id: branches/unicodertl@12189 -
yury преди 17 години
родител
ревизия
6c7be4018b
променени са 1 файла, в които са добавени 6 реда и са изтрити 3 реда
  1. 6 3
      rtl/win32/system.pp

+ 6 - 3
rtl/win32/system.pp

@@ -314,8 +314,6 @@ procedure asm_exit;stdcall;external name 'asm_exit';
 
 Procedure system_exit;
 begin
-  SysFreeMem(FArgs);
-  SysFreeMem(FArgv);
   { don't call ExitProcess inside
     the DLL exit code !!
     This crashes Win95 at least PM }
@@ -1050,7 +1048,7 @@ function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;
 	end;
 
 
-begin
+initialization
   { get some helpful informations }
   GetStartupInfo(@startupinfo);
 
@@ -1091,5 +1089,10 @@ begin
   InitWin32Widestrings;
   DispCallByIDProc:=@DoDispCallByIDError;
   SysInitStdIO;
+
+finalization
+  SysFreeMem(FArgs);
+  SysFreeMem(FArgv);
+
 end.