Jump to content

Ghost GUI


xP3NG3Rx

Recommended Posts

  • Honorable Member

Hello.

I was looking inside the official python files and I found a little fix for this:

Let me explain a bit the problem. If you leave open the inventory/dragon soul inventory/expanded taskbar or the affected objects and then you are using quest for teleportation, the windows what you left open will be closed because of the quest and when the quest executed those windows what you left open before would be opened again, but the warp is killing this procedure and that happens what you can see in the video, the windows are there but you cannot see them. Btw you can close them with escape key.

The fix is coming from webzen:
Simple, just execute a .Hide() function before the Destroy function has been called on that object what is stuck on the main window after teleport and that's it.

For example:

interfaceModule.py -> Interface class -> Close function:

		if self.wndInventory:
			self.wndInventory.Hide()#fix
			self.wndInventory.Destroy()
		if self.wndDragonSoul:
			self.wndDragonSoul.Hide()#fix
			self.wndDragonSoul.Destroy()
  • Metin2 Dev 1
  • Love 21
Link to comment
Share on other sites

  • Honorable Member
5 hours ago, xP3NG3Rx said:

The fix is coming from webzen:
Simple, just execute a .Hide() function before the Destroy function has been called on that object what is stuck on the main window after teleport and that's it.

Technically, this is a work-around, because the previous "ghost interface" is still there, but it remains just hidden (undeleted).

You get such bug due to a python's garbage collector "issue/condition" when destroying the relative class:

Since, in your case, the class' object count is higher than 1, when deleting self, the object count is decreased by 1, but since it doesn't still become 0, self doesn't get destroyed at all. (and del self.wndInventory wouldn't trigger def __del__ either)

Normally, the object count for gui instances should remain as 1, but (mostly in every case) if someone during a .SetEvent (or similar) passed the self parameter without proxing it (proxy=creating a weak uncounted instance of self), it will lead to create 2 self instances in two different modules (interfaceModule and ui in this case), which means the object count will be >=2, and then you'll get a "ghost interface" when rewarping.

Even so, considering everything beside self gets still deleted (i mean, its internal elements get deleted except the methods; that's why ESC still works), putting a .Hide() in there is still safe. (the memory leak would still remain unfixed though; maybe after retriggering the bug the "ghost interface" gets deleted, but a new one would still be generated to replace it)

  • Metin2 Dev 1
  • Love 3
Link to comment
Share on other sites

This is actually a issue either me or the the developers that came after me brought into the rubinum source.

The better fix is fixing it in the window manager or martysamas approach.

Ymir actually already solved this in the Inferna source by introducing ui_event.py

This is the hidden content, please

Here you have it.

Basically when setting an event you use MakeEvent and when calling SetEvent you just give the argument if it has arguments you do Event(func, arg, arg, arg) for example

That way you eliminate cyclic references.

Also in the window manager there is an define you can enable to find elements that were not properly deleted

so you can fix it by properly deleting in Destroy or __del__

 

  • Metin2 Dev 43
  • Eyes 2
  • Good 7
  • Love 1
  • Love 12
Link to comment
Share on other sites

  • Honorable Member
Spoiler

 

I know, I know. I do not know why the temperatures going up to the skies. I have under my laptop a Klim Cyclone and on the side a Klim Tornado.
If the fanboost is on max level and every cooler is on the avg. temps is 45°C on CPU and GPU also. (During game it's 85-90)
And this shit is just 1 year old.

fcb59251a5.png

 

 

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

3 hours ago, xP3NG3Rx said:
  Hide contents

 

I know, I know. I do not know why the temperatures going up to the skies. I have under my laptop a Klim Cyclone and on the side a Klim Tornado.
If the fanboost is on max level and every cooler is on the avg. temps is 45°C on CPU and GPU also. (During game it's 85-90)
And this shit is just 1 year old.

fcb59251a5.png

 

 

take out the dust then ! thats why i hate laptops :D 
i normally take it to the gas station or tires shop and use the high pressure air to get them out :P 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

  • 5 years later...
On 2/19/2018 at 2:48 PM, Baumi said:

This is actually a issue either me or the the developers that came after me brought into the rubinum source.

The better fix is fixing it in the window manager or martysamas approach.

Ymir actually already solved this in the Inferna source by introducing ui_event.py

This is the hidden content, please

Here you have it.

Basically when setting an event you use MakeEvent and when calling SetEvent you just give the argument if it has arguments you do Event(func, arg, arg, arg) for example

That way you eliminate cyclic references.

Also in the window manager there is an define you can enable to find elements that were not properly deleted

so you can fix it by properly deleting in Destroy or __del__

 

if someone would have the kindness to reupload this archive i'd be more than thankful 🫡

Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.