Memory leak fix.

Register the shutdown callback to properly clear the onresize event handler.