Sha256: f8da43c9959f1db72d9394641dacfde1919c74407a86db10cc7b9971eba29036

Contents?: true

Size: 655 Bytes

Versions: 2

Compression:

Stored size: 655 Bytes

Contents

# frozen_string_literal: true
class Shoes
  module Swt
    module Common
      module Remove
        def remove
          app.remove_paint_listener @painter
          remove_click_listeners
          @real.dispose unless @real.nil? || @real.disposed?
          dispose_held_resources
          dispose
        end

        def dispose_held_resources
          @color_factory&.dispose
        end

        # Classes should override to dispose of any Swt resources they create
        def dispose
        end

        private

        def remove_click_listeners
          app.click_listener.remove_listeners_for(dsl)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
shoes-swt-4.0.0.pre12 lib/shoes/swt/common/remove.rb
shoes-swt-4.0.0.pre11 lib/shoes/swt/common/remove.rb