MOG RIN Title Screen shows memory leaks

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,661
Reaction score
563
First Language
English
Primarily Uses
RMVXA
This script was found in a zip file that I got from somewhere (I don't remember and can't find again).

It needs these files
http://www.mediafire.com/file/irvxogj7512gv1i/Files.zip

During test play, with the console open. There are several entries regarding the skull image and title commands.
console.png

Is there anyone with enough ruby knowledge to see what is wrong and maybe fix it?

Thanks

Oops, forgot this image with the zip file.
Particles.png
 
Last edited:

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
You may ask to the author MogHunter (int the script header)
who can adress this issue.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,661
Reaction score
563
First Language
English
Primarily Uses
RMVXA
I should have tried my tests first before posting this.

I think it's good now. I played around with different options (I look at whats in the script and try different things)
I added in 4 extra lines and now the messages do not show up.

Title commands dispose section
@com.each {|sprite| sprite.dispose }
@com.each {|sprite| sprite.bitmap.dispose }

Title Skulls dispose section
@skulls.each {|sprite| sprite.dispose }
@skulls.each {|sprite| sprite.bitmap.dispose }

SO now it looks like this
Code:
  #--------------------------------------------------------------------------
  # ● Dispose Commands
  #--------------------------------------------------------------------------               
  def dispose_commands
      @com.each {|sprite| sprite.dispose_sprites }
      @com.each {|sprite| sprite.dispose }
      @com.each {|sprite| sprite.bitmap.dispose }
  end 
 
  #--------------------------------------------------------------------------
  # ● Dispose Skulls
  #--------------------------------------------------------------------------               
  def dispose_skulls
      @skulls.each {|sprite| sprite.dispose_sprites }
      @skulls.each {|sprite| sprite.dispose }
      @skulls.each {|sprite| sprite.bitmap.dispose }
  end
This is now solved for me.
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
No this will provoke memory leak the script wasnt originally having memory leak its just print what its doing
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,661
Reaction score
563
First Language
English
Primarily Uses
RMVXA
Thanks for telling me.
I tested some more and it works with only the one line.
Code:
@com.each {|sprite| sprite.dispose }
@skulls.each {|sprite| sprite.dispose }
Does that make it better?
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
You dont need to modify the script
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
No this will provoke memory leak the script wasnt originally having memory leak its just print what its doing
The script got memory leaks, at least the one posted in the opening post surely does.
None of the Title_Commands and Title_Skull objects were disposed properly, which equals memory leaks.
Only their bitmaps are disposed, the objects themselves are not (and since their superclass is Sprite, they need to be disposed).
This wouldn't be the first time I find memory leaks in Moghunter's scripts, so it's really nothing unusual or unbelievable.

This should be the most efficient code to dispose everything properly:
Code:
  def dispose_commands
    @com.each {|sprite| sprite.bitmap.dispose; sprite.dispose }
  end
 
  def dispose_skulls
    @skulls.each {|sprite| sprite.bitmap.dispose; sprite.dispose }
  end
One iteration is enough, everything can be done inside that. And just to make sure everything goes right, always dispose the bitmap first, the object after that.

For the record, Moghunter's dispose_sprites method got nothing to do with disposing the actual Sprite object, it only disposes the sprite's bitmap. Basically, using sprite.bitmap.dispose is the same as using sprite.dispose_sprites.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,661
Reaction score
563
First Language
English
Primarily Uses
RMVXA
@Sixth Thank you. Nothing shows up in the console, so I can only assume it's all good.
 

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

Latest Threads

Latest Profile Posts

I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:
attack on titan final season is airing tomorrow, I'm excited and scared at the same time!

Forum statistics

Threads
105,882
Messages
1,017,230
Members
137,607
Latest member
Maddo
Top