diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2009-01-15 07:57:27 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2009-01-15 07:57:27 +0000 |
commit | 7bcf346410d13a031025bcdeb87c4bed4bc4dd5a (patch) | |
tree | 9f76a93c1df2e2eb8387f634b70d1df6aec721a6 /ACE/ace/Cleanup.cpp | |
parent | 903a1678de138d6dbb4711be1decb816ab86bb88 (diff) | |
download | ATCD-7bcf346410d13a031025bcdeb87c4bed4bc4dd5a.tar.gz |
Thu Jan 15 07:56:02 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl>
* ace/Cleanup.{h,cpp}:
Added a const char* name member to ACE_Cleanup_Info_Node, this
can be passed in when registering an at_exit hook. This string can
then be used during debugging to detect problems at shutdown. It
can happen that the cleanup hook is from a dll that already is
unloaded and then we get a crash with no information, the string
at least can tell us which hook we are calling. This fixes bugzilla
3544.
* ace/Log_Msg.cpp:
* ace/Object_Manager.{h,cpp,inl}:
* ace/Object_Manager_Base.{h,cpp}:
* ace/OS_NS_stdlib.{h,inl}:
* ace/Process_Manager.cpp:
* ace/Singleton.cpp:
* ace/Token_Invariants.cpp:
* ace/Token_Manager.cpp:
Pass in the typeid of the object when registering an at_exit hook
* ace/Thread.cpp:
Moved local variable inside the loop
Diffstat (limited to 'ACE/ace/Cleanup.cpp')
-rw-r--r-- | ACE/ace/Cleanup.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/ACE/ace/Cleanup.cpp b/ACE/ace/Cleanup.cpp index 2c8ba21d8f1..9be6235556c 100644 --- a/ACE/ace/Cleanup.cpp +++ b/ACE/ace/Cleanup.cpp @@ -11,6 +11,7 @@ ACE_RCSID (ace, #endif /* ACE_HAS_INLINED_OSCALLS */ #include "ace/OS_Memory.h" +#include "ace/os_include/os_typeinfo.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -37,20 +38,22 @@ ACE_CLEANUP_DESTROYER_NAME (ACE_Cleanup *object, void *param) ACE_Cleanup_Info_Node::ACE_Cleanup_Info_Node (void) : object_ (0), cleanup_hook_ (0), - param_ (0) + param_ (0), + name_ (0) { } ACE_Cleanup_Info_Node::ACE_Cleanup_Info_Node (void *object, ACE_CLEANUP_FUNC cleanup_hook, - void *param) + void *param, + const char *name) : object_ (object), cleanup_hook_ (cleanup_hook), - param_ (param) + param_ (param), + name_ (name) { } - ACE_Cleanup_Info_Node::~ACE_Cleanup_Info_Node (void) { } @@ -83,14 +86,15 @@ ACE_OS_Exit_Info::~ACE_OS_Exit_Info (void) int ACE_OS_Exit_Info::at_exit_i (void *object, ACE_CLEANUP_FUNC cleanup_hook, - void *param) + void *param, + const char* name) { // Return -1 and sets errno if unable to allocate storage. Enqueue // at the head and dequeue from the head to get LIFO ordering. ACE_Cleanup_Info_Node *new_node = 0; ACE_NEW_RETURN (new_node, - ACE_Cleanup_Info_Node (object, cleanup_hook, param), + ACE_Cleanup_Info_Node (object, cleanup_hook, param, name), -1); registered_objects_.push_front (new_node); |