remove the concept of a main context

app closes when all contexts close now
This commit is contained in:
Jill 2023-06-02 15:34:52 +03:00
parent ebc98715be
commit 7fcf926426
Signed by: oat
GPG Key ID: 33489AA58A955108
1 changed files with 1 additions and 3 deletions

View File

@ -28,17 +28,15 @@ module Funfriend
LOG = ::Log.for("")
@@contexts = [] of WindowContext
@@main_context : WindowContext?
def self.should_close?
@@main_context && @@main_context.not_nil!.window.should_close?
@@contexts.size == 0
end
def self.init_contexts
ConfigMan.config["buddies"]["types"].as(String).split(",").each do |buddy_name|
add_context(BuddyContext.new(make_buddy(buddy_name)))
end
@@main_context = @@contexts[0]
at_exit { contexts.each &.destroy }
end