File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -92,7 +92,10 @@ var DataManager = new Class({
9292 */
9393 this . _frozen = false ;
9494
95- this . events . once ( 'destroy' , this . destroy , this ) ;
95+ if ( this . events )
96+ {
97+ this . events . once ( 'destroy' , this . destroy , this ) ;
98+ }
9699 } ,
97100
98101 /**
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ var DataManagerPlugin = new Class({
3030
3131 function DataManagerPlugin ( scene )
3232 {
33- DataManager . call ( this , this . scene , scene . sys . events ) ;
33+ DataManager . call ( this , scene , scene . sys . events ) ;
3434
3535 /**
3636 * [description]
@@ -64,7 +64,12 @@ var DataManagerPlugin = new Class({
6464 */
6565 start : function ( )
6666 {
67- this . events = this . scene . sys . events ;
67+ if ( this . events )
68+ {
69+ this . events . off ( 'destroy' , this . destroy , this ) ;
70+ }
71+
72+ this . events = this . systems . events ;
6873
6974 var eventEmitter = this . systems . events ;
7075
@@ -98,7 +103,7 @@ var DataManagerPlugin = new Class({
98103 {
99104 DataManager . prototype . destroy . call ( this ) ;
100105
101- this . scene . sys . events . off ( 'start' , this . start , this ) ;
106+ this . systems . events . off ( 'start' , this . start , this ) ;
102107
103108 this . scene = null ;
104109 this . systems = null ;
You can’t perform that action at this time.
0 commit comments