Event on map load/switch

Hi,
I write a plugin which add some components to existing actors and reacts if they get unregistered. Now I need to detect if the user switches the map and do some work before they get unregistered. I can not place the code in the OnUnregister() of the components, because I only want to react if the map(or level) gets switched.

I tried to place a dummy actor in the current map and listen on its BeginDestroy(). This works, but would be useful only, if this is called before any other actor component gets unregistered. This does not happen.

Here a debug log which should explain the point in time to react:

<-- user double clicks in unreal editor content browser on a map to load -->
Cmd: MAP LOAD FILE="../devproject_4_16/Content/StarterContent/Maps/Advanced_Lighting.umap" TEMPLATE=0 SHOWPROGRESS=1 FEATURELEVEL=3
LightingResults: New page: Lighting Build
LoadErrors: New page: Loading map: Advanced_Lighting.umap
<-- Last point to react! -->
LogTemp:Warning: Actor component unregistered.
<--  To late; one of the interesting components already have unregistered -->
LogTemp:Warning: Actor component unregistered.
....
MapCheck: New page: Map Check
LightingResults: New page: Lighting Build
LogTemp:Warning: BeginDestroy   <-- here comes the BeginDestroy event from the dummy actor. Unfortunately to late!

How to get in this tiny time slot after map switch begins?

Thanks for any help, solarisx

How about using FWorldDelegates::LevelRemovedFromWorld delegate?

FWorldDelegates::LevelRemovedFromWorld does not fire in my case, but thanks for pointing me on FWorldDelegates! Was focused on Levels and Maps and did not thought of World.
So I found FWorldDelegates::OnPreWorldInitialization, which is what I need.

Thanks very much!