Skip to content

Commit

Permalink
fixed that Painter was not disposed with Starling (closes #906)
Browse files Browse the repository at this point in the history
  • Loading branch information
PrimaryFeather committed Sep 27, 2016
1 parent 7ef81e7 commit 9488355
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions starling/src/starling/core/Starling.as
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,12 @@ package starling.core
for each (var touchEventType:String in touchEventTypes)
_nativeStage.removeEventListener(touchEventType, onTouch, false);

_touchProcessor.dispose();
_painter.dispose();
_stage.dispose();

var index:int = sAll.indexOf(this);
if (index != -1) sAll.removeAt(index);

if (_touchProcessor) _touchProcessor.dispose();
if (_stage) _stage.dispose();
if (sCurrent == this) sCurrent = null;
}

Expand Down Expand Up @@ -965,7 +966,8 @@ package starling.core
public function get touchProcessor():TouchProcessor { return _touchProcessor; }
public function set touchProcessor(value:TouchProcessor):void
{
if (value != _touchProcessor)
if (value == null) throw new ArgumentError("TouchProcessor must not be null");
else if (value != _touchProcessor)
{
_touchProcessor.dispose();
_touchProcessor = value;
Expand Down

0 comments on commit 9488355

Please sign in to comment.