From 515c13e6de6f00a0d48d7dcf91029caa8448e0a7 Mon Sep 17 00:00:00 2001 From: Dimitar Toshev Date: Wed, 19 Jun 2024 23:12:07 +0300 Subject: [PATCH] Delete Tf_RegistryManagerImpl instance when appropriate. --- pxr/base/tf/registryManager.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pxr/base/tf/registryManager.cpp b/pxr/base/tf/registryManager.cpp index 848343b358..f7e8b7508e 100644 --- a/pxr/base/tf/registryManager.cpp +++ b/pxr/base/tf/registryManager.cpp @@ -170,6 +170,10 @@ class Tf_RegistryManagerImpl { return TfSingleton::GetInstance(); } + static void DeleteInstance() { + TfSingleton::DeleteInstance(); + } + /// Stores the active library's registration functions and runs those /// that are subscribed to then makes no library active. Returns an /// identifier that can be passed to \c UnloadLibrary(). @@ -548,7 +552,10 @@ TfRegistryManager::TfRegistryManager() TfRegistryManager::~TfRegistryManager() { - // Do nothing + // Delete the actual instance. + // If we get here, then this instance is being deleted, which means nobody + // can use TfRegistryManager any more. + Tf_RegistryManagerImpl::DeleteInstance(); } TfRegistryManager&