| View previous topic :: View next topic |
| Author |
Message |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25823 Location: The netherlands
|
Posted: Fri Dec 13, 2013 5:30 pm Post subject: |
|
|
when a process has been closed windows will free all the memory it has allocated(Unless your dll does something really horrible like loading a kernelmode driver which allocates a gigabyte or more of nonpaged memory)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
dlpb Advanced Cheater
Reputation: 0
Joined: 11 Dec 2013 Posts: 78
|
Posted: Fri Dec 13, 2013 5:58 pm Post subject: |
|
|
| So that means form1.free is very seldom required in ANY application? Just placing cafree in the onclose would do?
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25823 Location: The netherlands
|
Posted: Fri Dec 13, 2013 6:08 pm Post subject: |
|
|
Just exiting the thread when application.run returns is enough
Also, freeing an already freed form is a really bad idea.
I also don't recommend putting caFree as close action on the main form(or any form that's part of the main application), firstly, it's not needed, and most importantly is that it doesn‘t nil the variables that point to the form. If it‘s not nil then when application.run terminates calls functions on it (e.g. form.hide) and since it's freed that will cause unpredicted behaviour
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
dlpb Advanced Cheater
Reputation: 0
Joined: 11 Dec 2013 Posts: 78
|
Posted: Fri Dec 13, 2013 6:35 pm Post subject: |
|
|
Thanks for all your help
|
|
| Back to top |
|
 |
dlpb Advanced Cheater
Reputation: 0
Joined: 11 Dec 2013 Posts: 78
|
Posted: Sat Dec 14, 2013 4:24 am Post subject: |
|
|
| From what I can see this error only happens on XP. After XP, the error does not show up. OSs after XP obviously dealt with missing handles better.
|
|
| Back to top |
|
 |
dlpb Advanced Cheater
Reputation: 0
Joined: 11 Dec 2013 Posts: 78
|
Posted: Sun Dec 15, 2013 2:01 pm Post subject: |
|
|
OK, this problem was solved over at another forum. As follows:
| Code: | form1:=Tform1.Create(nil);
form1.visible:=true; (so it doesn't override the shownoactivate)
repeat
Application.HandleMessage;
until form1cancloseflag;
Form1.Close;
|
Then, in the oncreate of form1:
| Code: | | ShowWindow(Handle, SW_SHOWNOACTIVATE); |
This has no error message on game close (from what I can see the error only happens with XP anyway), and it solves all other issues.
|
|
| Back to top |
|
 |
|