fix emergemanager memory leaks (depends on server smartpointer fix!)