UPBGE / upbge

UPBGE, the best integrated game engine in Blender
https://upbge.org
Other
1.39k stars 177 forks source link

Try to improve BL_KetsjiEmbedStart #1848

Closed youle31 closed 9 months ago

youle31 commented 9 months ago

EDIT: Not stable

It is using WM_file_read to load a new .blend or when restart game is called instead of old "load_game_data".

We avoid to free pre-runtime wm->undo_stack during the whole runtime. At the end of runtime, WM_file_read is called again to load the pre-runtime file, and we assign the undo_stack that we saved to the wmWindowManager of the read file.

There is a remaining memory leak reported in console, i didn't find the cause.

It is avoiding this assert: https://github.com/UPBGE/upbge/issues/1805

I tested with few test files (I don't have many "restart-load" files) and it sounds to work ok.

Test files used: restart-load.zip

youle31 commented 9 months ago

I close this for now