when I close the main window from the "X" the application is closed, but in reality the exe remains in memory on the computer causing memory leaks.
I can't find the error.
In reality the problem occurs when the Tcalex () class is called: everything is working but if the final user closes the main window the exe remains in memory which is not the case for the other procedures.
the problem does not always manifest itself
there are also moments when if the user closes the window from the "X" it also closes the exe in memory
if tcalex is open in the "Month" view, the exe closes, if instead tcalex is open in the "Daily" or week view
then the exe does not close even if the user returns to the Month view
By chance is there a function or a procedure that goes to check if the exe is still in memory and if it closes it?
I made some checks and I saw there is something no closed on TMonthView or TweekView while on tdayview is ok
Quit a process exe
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Quit a process exe
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: Quit a process exe
Now I found a function
it seems to close the exe
HB_GCALL( .t. ) at Begin of Main.prg
then
MemoryFlush() when the exe must be closed
FUNCTION MemoryFlush()
SetProcess( -1, -1, -1 )
RETURN NIL
DLL32 Function SetProcess( hWnd As LONG, nMinWorkingSpace As LONG, nMaxWorkingSpace As LONG ) As LONG PASCAL From "SetProcessWorkingSetSize" Lib "Kernel32.dll"
But I not Know if it run for ever
it seems to close the exe
HB_GCALL( .t. ) at Begin of Main.prg
then
MemoryFlush() when the exe must be closed
FUNCTION MemoryFlush()
SetProcess( -1, -1, -1 )
RETURN NIL
DLL32 Function SetProcess( hWnd As LONG, nMinWorkingSpace As LONG, nMaxWorkingSpace As LONG ) As LONG PASCAL From "SetProcessWorkingSetSize" Lib "Kernel32.dll"
But I not Know if it run for ever
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Re: Quit a process exe
Silvio:
https://docs.microsoft.com/en-us/window ... uitmessage
Code: Select all
PostQuitMessage(0)
QUIT
https://docs.microsoft.com/en-us/window ... uitmessage
Saludos / Regards,
FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: Quit a process exe
I have tried both with:
i tried with
always the same remains the "exe" file in memory (in the management of windows activities ) as you can see in this figure
I have a simple window which I then activate with
on exitfromX method there is this
Please Help Me , this happened only with Tcalex class !!!
I don't think anyone who uses tcalex doesn't have this problem
Code: Select all
PostMessage (0)
quit
Code: Select all
HB_GCALL (.t.)
MemoryFlush ()
I have a simple window which I then activate with
Code: Select all
ACTIVATE WINDOW :: oWndMain
VALID :: ExitFromX ()
on exitfromX method there is this
Code: Select all
if msgYesNo( i18n("¿exit?") )
SetWinCoors( ::oWndMain, ::cIniFile )
MemoryFlush()
RETURN .t.
end
Please Help Me , this happened only with Tcalex class !!!
I don't think anyone who uses tcalex doesn't have this problem
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Re: Quit a process exe
Hello Silvio,
maybe you can check the class. Is your class registerd?
Maybe this from Petzold's book help?
Best regards,
Otto
maybe you can check the class. Is your class registerd?
Maybe this from Petzold's book help?
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: Quit a process exe
Otto wrote:Hello Silvio,
maybe you can check the class. Is your class registerd?
Maybe this from Petzold's book help?
Best regards,
Otto
Dear Otto,
what question you ask me
I use Tcalex class on a Dialog ( style ws_child) and this dialog is on a Window ( no Mdi)
this class is registred ?
do not be a professor with me, it is not necessary to show me books and texts,
the error is in the Tcalex which if inserted in a window does not come out if instead it is inserted in a dialog creates problems
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC