summaryrefslogtreecommitdiff
path: root/ACE/ace/DLL_Manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/ace/DLL_Manager.cpp')
-rw-r--r--ACE/ace/DLL_Manager.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/ACE/ace/DLL_Manager.cpp b/ACE/ace/DLL_Manager.cpp
index 09f3e2f40b5..9d13cb43b09 100644
--- a/ACE/ace/DLL_Manager.cpp
+++ b/ACE/ace/DLL_Manager.cpp
@@ -28,9 +28,15 @@ ACE_DLL_Handle::~ACE_DLL_Handle (void)
{
ACE_TRACE ("ACE_DLL_Handle::~ACE_DLL_Handle");
this->close (1);
+#if defined (ACE_HAS_ALLOC_HOOKS)
+ ACE_Allocator::instance()->free(this->dll_name_);
+#else
delete[] this->dll_name_;
+#endif /* ACE_HAS_ALLOC_HOOKS */
}
+ACE_ALLOC_HOOK_DEFINE(ACE_DLL_Handle)
+
const ACE_TCHAR *
ACE_DLL_Handle::dll_name (void) const
{
@@ -596,6 +602,8 @@ ACE_DLL_Manager::~ACE_DLL_Manager (void)
ACE_TEXT ("properly.\n")));
}
+ACE_ALLOC_HOOK_DEFINE(ACE_DLL_Manager)
+
ACE_DLL_Handle *
ACE_DLL_Manager::open_dll (const ACE_TCHAR *dll_name,
int open_mode,
@@ -711,9 +719,15 @@ ACE_DLL_Manager::open (int size)
ACE_DLL_Handle **temp = 0;
+#if defined (ACE_HAS_ALLOC_HOOKS)
+ ACE_ALLOCATOR_RETURN (temp,
+ static_cast<ACE_DLL_Handle**> (ACE_Allocator::instance()->malloc(sizeof (ACE_DLL_Handle*) * size)),
+ -1);
+#else
ACE_NEW_RETURN (temp,
ACE_DLL_Handle *[size],
-1);
+#endif /* ACE_HAS_ALLOC_HOOKS */
this->handle_vector_ = temp;
this->total_size_ = size;
@@ -742,7 +756,12 @@ ACE_DLL_Manager::close (void)
}
}
+#if defined (ACE_HAS_ALLOC_HOOKS)
+ ACE_Allocator::instance()->free(this->handle_vector_);
+#else
delete [] this->handle_vector_;
+#endif /* ACE_HAS_ALLOC_HOOKS */
+
this->handle_vector_ = 0;
this->current_size_ = 0;
}