ADD: Some debugging info at startup/shutdown.

This commit is contained in:
cobines 2010-11-07 02:26:17 +00:00
commit f45341be63
6 changed files with 26 additions and 5 deletions

View file

@ -36,6 +36,8 @@ uses
begin
{$I doublecmd.lrs}
DebugLn('Starting Double Commander');
{$IFDEF NIGHTLY_BUILD}
InitLineInfo;
{$ENDIF}
@ -90,4 +92,6 @@ begin
begin
DebugLn('Another instance of DC is already running. Exiting.');
end;
end.
DebugLn('Finished Double Commander');
end.

View file

@ -860,13 +860,14 @@ procedure TfrmMain.FormDestroy(Sender: TObject);
var
slCommandHistory: TStringListEx;
begin
DebugLn('frmMain.Destroy');
DebugLn('Destroying main form');
// Disable file watcher.
if Assigned(LeftFrameWatcher) then
FreeAndNil(LeftFrameWatcher);
if Assigned(RightFrameWatcher) then
FreeAndNil(RightFrameWatcher);
DebugLn('File watchers finished');
// Close all tabs.
CloseNotebook(LeftTabs);
@ -887,6 +888,8 @@ begin
SaveMainToolBar;
DestroyDrivesList(DrivesList);
DebugLn('Main form destroyed');
end;
procedure TfrmMain.FormCloseQuery(Sender: TObject; var CanClose: boolean);

View file

@ -2978,6 +2978,7 @@ begin
// Wait until all the builders finish.
FListFilesThread.Finish;
DebugLn('Waiting for FileListBuilder thread ', hexStr(FListFilesThread));
TFunctionThread.WaitForWithSynchronize(FListFilesThread);
FListFilesThread := nil;
end;
@ -5090,4 +5091,4 @@ begin
end;
end.

View file

@ -214,12 +214,14 @@ end;
procedure InitializeGuiMessageQueue;
begin
DebugLn('Starting GuiMessageQueue');
GuiMessageQueue := TGuiMessageQueueThread.Create(False);
end;
procedure FinalizeGuiMessageQueue;
begin
GuiMessageQueue.Terminate;
DebugLn('Finishing GuiMessageQueue');
WaitForThreadTerminate(GuiMessageQueue.ThreadID, 10000); // wait max 10 seconds
end;

View file

@ -133,12 +133,14 @@ var
begin
Result := False;
DebugLn('Initializing HAL');
// create new HAL
DcHalCtx := libhal_ctx_new;
if DcHalCtx = nil then
begin
DebugLn('Cannot initialize HAL context');
DebugLn('Cannot create HAL context');
Exit;
end;
@ -161,6 +163,7 @@ begin
// Set dbus connection for the HAL context.
if libhal_ctx_set_dbus_connection(DcHalCtx, DcDbus) = 0 then
begin
DebugLn('Cannot set DBUS connection for HAL context');
FreeHal;
Exit;
end;
@ -191,12 +194,13 @@ begin
Exit;
end;
DebugLn('HAL initialized OK');
Result := True;
end;
procedure LibHalDeviceAdded(ctx: PLibHalContext; const udi: PChar); cdecl;
begin
// DebugLn('add dev ',udi);
DebugLn('HAL: new device added: ',udi);
// sleep(1500); // if we dont do it we don`t see new dev
CheckBlockDev(ctx,udi,nil); // it return value 2 time on one flash like /dev/sda /dev/sda1
end;
@ -217,6 +221,7 @@ begin
DeviceList.Delete(DeviceList.IndexOf(udi));
//CreateBlokDevArr; or we can re create DeviceList
end;
DebugLn('HAL: Device was removed: ', udi);
end;
function CheckHalMsg: Boolean;
@ -244,6 +249,7 @@ begin
begin
if HalConnectionOpen then
begin
DebugLn('Shutting down HAL');
libhal_ctx_shutdown(DcHalCtx, nil);
HalConnectionOpen := False;
end;
@ -254,6 +260,7 @@ begin
begin
if DBusConnectionOpen then
begin
DebugLn('Closing DBUS connection');
dbus_connection_close(DcDbus);
DBusConnectionOpen := False;
end;

View file

@ -1736,6 +1736,7 @@ end;
procedure LoadPixMapManager;
begin
DebugLn('Creating PixmapManager');
PixMapManager:=TPixMapManager.Create;
PixMapManager.Load(gpCfgDir + 'pixmaps.txt');
end;
@ -1745,7 +1746,10 @@ initialization
finalization
if Assigned(PixMapManager) then
begin
DebugLn('Shutting down PixmapManager');
FreeAndNil(PixMapManager);
end;
end.