Page MenuHomeFeedback Tracker

onUnload handler of rscTitles nested classes is never called
Reviewed, WishlistPublic

Description

Removing the current rscTitles resource should call onUnload of that resource. Please read steps to reproduce.

Details

Legacy ID
3323827118
Severity
None
Resolution
Open
Reproducibility
Have Not Tried
Category
Scripting
Steps To Reproduce

0. Create myClass in rscTitles, add onUnload to myClass

  1. ("myClass" call BIS_fnc_rscLayer) cutRsc ["myClass","PLAIN"];
  2. Execute the code from step 1 again, onUnload is not called (onLoad called twice at this point) <<<--- BUG HERE
  1. ("myClass" call BIS_fnc_rscLayer) cutRsc ["myClass","PLAIN"];
  2. ("myClass" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; - layer removed (please read Killzone_Kid's comment about cutText here - https://community.bistudio.com/wiki/cutRsc ), but onUnload is not called <<<--- BUG HERE
  1. ("myClass" call BIS_fnc_rscLayer) cutRsc ["myClass","PLAIN"];
  2. ("myClass" call BIS_fnc_rscLayer) cutRsc ["Default","PLAIN"]; - layer removed, but onUnload is not called <<<--- BUG HERE

Event Timeline

sms edited Steps To Reproduce. (Show Details)Sep 2 2014, 11:06 AM
sms edited Additional Information. (Show Details)
sms set Category to Scripting.
sms set Reproducibility to Have Not Tried.
sms set Severity to None.
sms set Resolution to Open.
sms set Legacy ID to 3323827118.May 7 2016, 7:21 PM
Bohemia added a subscriber: sms.Sep 2 2014, 11:06 AM

Confirmed. It looks like both unloads (config and scripted) are broken:

class rsctitles
{
class rsc
{

		idd = 12345;
		
		onload = "_d = _this select 0; _d displayAddEventHandler ['unload', {player sidechat 'unload scripted'}]; player sidechat str ['load', _d, finddisplay 12345];";
		onunload = "player sidechat 'unload config'";
		
		fadein = 0;
		fadeout = 0;
		duration = 5;
		class controls
		{
			class text: rscText
			{
				idc = 12345;
				text = "okwerewrewrewr";
				x = 0;
				y = 0;
				w = 1;
				h = 1;
			};
		};

};
};

sms added a comment.Sep 2 2014, 1:57 PM

Killzone_Kid: Thanks for you comment. Btw, I think onUnload should be also called after 'duration' seconds.

It should as if you run test on created display it ceases to exist after indicated duration. The interesting thing is, although display is created, it cannot be found with finddisplay, I think this is the reason "unload" is not fired.