You also free the icon... appIcon needs to be part of the main form or global.
You need to separate that and wait until application shutdown. You can re-use the same instance multiple times.
Also, at least on windows, the desktop needs a notification to repaint.