Fix for memory leak when opening topics