V's Promotion System memory leaks

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,674
Reaction score
566
First Language
English
Primarily Uses
RMVXA
https://forums.rpgmakerweb.com/index.php?threads/vs-promotion-system-v0-2.18875/

Found this to have memory leaks and tried it in another demo and same results.

Lines 597, 599, 601, 604, and 609. Basically every entry with window.new
597 -> @promotion_header_window = Promotion_Header_Window.new(0, 0, Graphics.width, 75)

Can someone help?

In the meantime, I'll go back to watching ruby tutorials.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
How do you identify it has memory leaks? I've seen nothing unusual there. Neither global object reference from Mithran nor task manager shown anything unusual.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,674
Reaction score
566
First Language
English
Primarily Uses
RMVXA
I reduced my scripts down to 4 in a test project.
leak1.PNG
leak2.PNG

Code:
-----
Time: 2018-11-06 17:20:34 -0500
Memory Leak #<Promotion_Header_Window:0x13072b88>
In Scene Scene_Map
Creation Stack::
Script 0125 -- Vindaka | Promotions, Line: 597:in `setup_promotion_windows'
Script 0125 -- Vindaka | Promotions, Line: 582:in `initialize'
Script 0006 -- SceneManager, Line: 60:in `new'
Script 0006 -- SceneManager, Line: 60:in `call'
Script 0125 -- Vindaka | Promotions, Line: 218:in `promote'
(eval):1:in `command_355'
Script 0040 -- Game_Interpreter, Line: 1411:in `eval'
Script 0040 -- Game_Interpreter, Line: 1411:in `command_355'
Script 0040 -- Game_Interpreter, Line: 197:in `execute_command'
Script 0040 -- Game_Interpreter, Line: 103:in `run'
Script 0040 -- Game_Interpreter, Line: 60:in `block in create_fiber'
-----
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
How did those windows even end up in Scene_Map? They should all be in V_Promotion_Scene. o_O

And just when I finished writing that, I noticed that it says initialize in your stack records...
That very first method in the V_Promotion_Scene class should be called start, not initialize.
 
Last edited:

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
Was gonna type stuff, but Sixth pointed out the important part.
In short, it's a false positive.

Global object reference recorded any window / sprites created.
And those windows get created when the scene is about to change (not after it). Marking it "hey it isn't yet disposed during the change from scene map to promotion!". But in the end, window is disposed after the scene change from promotion to map.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,674
Reaction score
566
First Language
English
Primarily Uses
RMVXA
Well thankfully it was easy for someone. Thank you @Sixth and @TheoAllen
Changing the scene from initialize to start stops the messages from showing up, so it looks like it's fixed.
Big Sigh...
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,038
Messages
1,018,467
Members
137,821
Latest member
Capterson
Top