Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology
Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered
You are not logged in.
my mediaoctopuslayer project creates many objects and images....and I haven't mapped out the destruction of all of them, although I'm pretty sure my code destroys all the objects it creates.
but just to be sure, when mainWindow closes down, is it ok to do something like this for all the objects created....
assume i know the type of each object i want to destroy...
can i test for the existence of the object, and if it is not nil, destroy it, just to be sure i've cleaned up all the objects i have created
so for example, lets say I create an AlphaBitmap somewhere in my code. i'm pretty sure i destroy it prior to closing down the app, but when mainwindow is closed down, can i write
if object !=nil //code to destroy object depending on object type// else nil;
Offline
There are two things you should do:
- When your app starts, you should call a function which initializes all your objects to nil. (simply declaring the object does'nt always set the variable to nil)
- When you quit the app, you then can test if an object is set to nil or not. Accuracy is then 100%.
Offline
There are two things you should do:
- When your app starts, you should call a function which initializes all your objects to nil. (simply declaring the object does'nt always set the variable to nil)
- When you quit the app, you then can test if an object is set to nil or not. Accuracy is then 100%.
thx...i think i will make it a habit to test the existence of every object created in my app and destroyed it if != nil
.....it turned out that the other processes were running from a few days ago when my app was not destroying all the objects/bitmaps/alphabitmaps/etc. i then did a full restart.
when the vm is running in the task tray, there is one process named scol.exe
when i open my project, there are two processes
when i close my project, there is one process
so i'm not leaving any objects hanging around after app shutdown.
Offline
Great!
Offline
When you destroy an object, set also the variable to nil explicitely, mostly with structures.
struct MyStruct =
field_1 : ...,
field_2 : ...,
....
] mkMyStruct;;
fun destroyField_1 (mystruct)=
// destroy the object
...
// then set the field to nil (not before the destroy)
set mystruct.field_1 = nil;
...
Offline
When you destroy an object, set also the variable to nil explicitely, mostly with structures.
struct MyStruct = field_1 : ..., field_2 : ..., .... ] mkMyStruct;; fun destroyField_1 (mystruct)= // destroy the object ... // then set the field to nil (not before the destroy) set mystruct.field_1 = nil; ...
I will do that thx
Offline