FIX: Memory leak.

This commit is contained in:
cobines 2011-03-24 21:44:36 +00:00
commit 65b4ae7409

View file

@ -488,19 +488,23 @@ begin
// Executing files directly only works for FileSystem.
aFile := TFileSystemFileSource.CreateFileFromFile(sFileName);
try
sCommand:= gExts.GetExtActionCmd(aFile, sCmd);
if sCommand <> '' then
begin
ReplaceExtCommand(sCommand, aFile, sActiveDir);
Result:= ProcessExtCommand(sCommand, sActiveDir);
end;
sCommand:= gExts.GetExtActionCmd(aFile, sCmd);
if sCommand <> '' then
begin
ReplaceExtCommand(sCommand, aFile, sActiveDir);
Result:= ProcessExtCommand(sCommand, sActiveDir);
end;
if not Result then
begin
mbSetCurrentDir(sActiveDir);
Result:= ShellExecute(sFileName);
end;
if not Result then
begin
mbSetCurrentDir(sActiveDir);
Result:= ShellExecute(sFileName);
end;
finally
FreeAndNil(aFile);
end;
end;
end.