Fix destroying of resource panel

beforeDestroy() is called directly from destroy() method