Skip to content

Commit

Permalink
Merge pull request #1456 from shoes/arrow-dispose
Browse files Browse the repository at this point in the history
Properly dispose of ArrowPainter

Changelog: bugfix
  • Loading branch information
PragTob committed Jul 15, 2017
2 parents 3914018 + 6864c79 commit 8ed4455
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions shoes-swt/lib/shoes/swt/arrow_painter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ def path
end
end

def dispose
clear_path
end

def clear_path
@path.dispose unless @path.nil? || @path.disposed?
@path = nil
end
end
Expand Down
5 changes: 5 additions & 0 deletions shoes-swt/spec/shoes/swt/arrow_painter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,9 @@
expect(gc).to receive(:fill_path).with(subject.path)
subject.paint_control(event)
end

it "disposes when clearing path" do
expect(subject.path).to receive(:dispose)
subject.clear_path
end
end

0 comments on commit 8ed4455

Please sign in to comment.