res:dock:: fix crashes when closing the last preview window.

when closing the last preview window, the preview is not closed, the preview
will be painted to null.