Parece que no liberas el Mutex.
Quizás se crea el mutex, pero da error porque ya existe y luego no se libera.
Yo siempre tengo el create seguido de try..finally. Dentro de esto el resto de la programación.
De esta manera evito la posibilidad de que no se libere por alguna condición escondida en la programación.
Código Delphi
[-]
o := TComponente.Create();
try
...
finally
o.Free;
end;
Código Delphi
[-]
var
IniAux: TIniFile;
Mutex : THandle;
begin
Mutex := CreateMutex(nil, True, 'GemaExclusiveMutex');
try
if (Mutex <> 0) And (Windows.GetLastError = 0) then
begin
with Application do
begin
if (ShortDateFormat = 'M/d/yyyy') then
begin
ShortDateFormat:='MM/dd/yyyy';
end;
CreateForm(TDMFJoya, DMFJoya);
CreateForm(TDM, DM);
CreateForm(TFMain, FMain);
if FMain.bErrorGrave then Exit;
FMain.Visible := False;
FMain.Show;
if not FMain.bModoAutomatico then
begin
FMain.WmAfterCreate;
end;
Run;
end;
DMFJoya.Free();
IniAux.Free;
end
else
ShowMessage('La aplicación ya está en ejecución');
finally
if Mutex <> 0 then
CloseHandle(Mutex);
end;
end;