lxn / walk

A Windows GUI toolkit for the Go Programming Language
Other
6.79k stars 885 forks source link

Should NotifyIcon destroy window in Dispose #682

Open jazzy-crane opened 4 years ago

jazzy-crane commented 4 years ago

Since NotifyIcon was recently changed to use a passed-in window, should it destroy that Window in it's Dispose function? I'm thinking of a case where the MainWindow is used for the NotifyIcon, and for whatever reason we want to Dispose the NotifyIcon before/without destroying the MainWindow.

jazzy-crane commented 4 years ago

@zx2c4 is this a hangover from when NotifyIcon created its own Window?

jazzy-crane commented 4 years ago

Would it make sense to add the NotifyIcon to the Window's disposables?

lxn commented 3 years ago

With https://github.com/lxn/walk/commit/638ab831d4b4839fd6a9b5642ccaeacccb5950b5 the window is no longer destroyed.

Your suggestion concerning the disposables makes sense. The Dispose method of NotifyIcon would have to be changed to return no error though.