SDockTab::SetOnTabClosed doesn't work when the Blueprint Editor is closed

Hi, I’m using SDockTab to create a tool that works within the Blueprint Editor. I register the following delegate to exit the tool process when the tab is closed.

EditorTab.Pin()->SetOnTabClosed(SDockTab::FOnTabClosedCallback::CreateLambda(= { Close(); }));

When the Blueprint Editor is closed, it works fine when the tab is not docked, but when it is docked, the delegate doesn’t seem to be called. What could be the cause of this?