Jump to content

UI elements don't always go away

Closed 2.0.8 2.0.9

mainloot
mainloot

Posted

Attached is an image showing the primary issue (top and bottom right): sometimes, some of the UI elements don't get cleaned up when skinner is closed. Initially, I noticed this error in logs when it happens:

 

NullReferenceException: Object reference not set to an instance of an object
  at Oxide.Plugins.Skinner+BoxController.OnDestroy () [0x000c0] in <d600f4f3223b46b1a12eddfd22098c4f>:0

 

So I checked out this function and saw that it happens here:

 

if (backpack != null)
    backpack.contents.onPreItemRemove -= PosWatch;

 

All I did to fix it was mimic what you do in StartItemSkin method and also check to see if backpack.contents is null, e.g.:

 

if (backpack != null && backpack.contents != null)
    backpack.contents.onPreItemRemove -= PosWatch;

 

Hope this helps anyone experiencing the same issue.

image.png

Whispers88

Posted

Changed Status from Pending to Closed

Changed Fixed In to 2.0.9

1.5m

Downloads

Total number of downloads.

7.2k

Customers

Total customers served.

107.6k

Files Sold

Total number of files sold.

2.2m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

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.