plugin onDestroy

For developers using the Construct 2 Javascript SDK

Post » Sat May 03, 2014 1:46 pm

Should I just null the vars I initialized in onCreate()?

Should I call something like this.runtime.removeDestroyCallback() as well?
B
5
S
1
Posts: 28
Reputation: 431

Post » Sun May 04, 2014 12:52 pm

You should remove any callbacks you added and null out any references to objects. The runtime recycles destroyed objects so you want to make sure your object is in a clean state again for having onCreate() called on the same object again later.
Scirra Founder
B
387
S
230
G
88
Posts: 24,251
Reputation: 192,464

Post » Sun May 04, 2014 4:53 pm

I understand, thanks.
B
5
S
1
Posts: 28
Reputation: 431


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests