dolphinsmalltalk / Dolphin

Dolphin Smalltalk Core Image
MIT License
301 stars 58 forks source link

SocketAbstract class>>#onShutdown improperly stripped #1103

Closed jgfoster closed 3 years ago

jgfoster commented 3 years ago

I've created an executable based on Dolphin 7.1.20 (thank you for the guidance to steer clear of master!). My basic smoke test went well till I closed the app and I got "SocketAbstract class does not understand #onShutdown". I looked at the deployment log and it was listed as removed because it was not sent. I added a sender and it is no longer stripped. Perhaps the method should be in a "do not strip" category?

blairmcg commented 3 years ago

The "must/must not strip" categories are a bit of a blunt instrument, so I like to try and understand why something is gone (or not gone) before wielding them

In this case the issue is that the only reference to onShutdown in the image is the class initialize method of SocketAbstract, because it sets up the event handler. Class initialize methods are normally removed at deployment time, so that would have left onShutdown unreferenced. I'm not sure what referenced it before, but whatever it was it must have been removed from 7.1 at some point. Usually in these cases I wield the blunt categorisation tool to force the class initialize method to be kept as there are often other event registrations.

BTW: You must be using the old Sockets Connection package that implement asynchronous operations using Windows messages. You might want to switch over to the "newer" Dolphin Sockets package. I was intending to remove the old package in the next version (that I think really ought to be called 8, rather than 7.2, given the level of change). It will still be in the repo, but no longer loaded in the image.