File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -705,15 +705,7 @@ var GameObject = new Class({
705705 this . body = undefined ;
706706 }
707707
708- if ( this . hasPostPipeline )
709- {
710- var pipelines = this . postPipelines ;
711-
712- for ( var i = 0 ; i < pipelines . length ; i ++ )
713- {
714- pipelines [ i ] . destroy ( ) ;
715- }
716- }
708+ this . resetPostPipeline ( true ) ;
717709
718710 // Tell the Scene to re-sort the children
719711 if ( ! fromScene )
Original file line number Diff line number Diff line change @@ -310,7 +310,8 @@ var Pipeline = {
310310 } ,
311311
312312 /**
313- * Resets the WebGL Post Pipelines of this Game Object.
313+ * Resets the WebGL Post Pipelines of this Game Object. It does this by calling
314+ * the `destroy` method on each post pipeline and then clearing the local array.
314315 *
315316 * @method Phaser.GameObjects.Components.Pipeline#resetPostPipeline
316317 * @webglOnly
@@ -322,6 +323,13 @@ var Pipeline = {
322323 {
323324 if ( resetData === undefined ) { resetData = false ; }
324325
326+ var pipelines = this . postPipelines ;
327+
328+ for ( var i = 0 ; i < pipelines . length ; i ++ )
329+ {
330+ pipelines [ i ] . destroy ( ) ;
331+ }
332+
325333 this . postPipelines = [ ] ;
326334 this . hasPostPipeline = false ;
327335
You can’t perform that action at this time.
0 commit comments