summaryrefslogtreecommitdiff
path: root/ace/Singleton.cpp
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1996-11-30 00:33:43 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1996-11-30 00:33:43 +0000
commit2d27f44666189e87ff27436b35a0dd002a0cdfd7 (patch)
treedd496dde3c016a1db5d3882e1dc40c9af7e9aaf8 /ace/Singleton.cpp
parent8460f65dd042d52eaaa80acfef7f288ab4ceb27a (diff)
downloadATCD-2d27f44666189e87ff27436b35a0dd002a0cdfd7.tar.gz
Eon
Diffstat (limited to 'ace/Singleton.cpp')
-rw-r--r--ace/Singleton.cpp40
1 files changed, 2 insertions, 38 deletions
diff --git a/ace/Singleton.cpp b/ace/Singleton.cpp
index 4a07aedb70c..5d6a6e8ea31 100644
--- a/ace/Singleton.cpp
+++ b/ace/Singleton.cpp
@@ -44,25 +44,7 @@ ACE_Singleton<TYPE, LOCK>::instance (void)
ACE_GUARD_RETURN (LOCK, ace_mon, ace_singleton_lock_, 0);
if (instance_ == 0)
- {
- // We can replace the following lines with this line once we
- // update the macro in OS.h
- // ACE_NEW_RETURN (instance_, TYPE, 0);
-
- instance_ = new TYPE;
- if (instance_ == 0)
- {
- errno = ENOMEM;
- return 0;
- }
- else if (ACE_LOG_MSG->op_status () == -1)
- {
- errno = ACE_LOG_MSG->errnum ();
- delete instance_;
- instance_ = 0;
- return 0;
- }
- }
+ ACE_NEW_RETURN (instance_, TYPE, 0);
}
return instance_;
@@ -74,25 +56,7 @@ ACE_Singleton<TYPE, LOCK>::instance (void)
ACE_GUARD_RETURN (LOCK, ace_mon, (ACE_Singleton<TYPE, LOCK>::ace_singleton_lock_), 0);
if (ACE_Singleton<TYPE, LOCK>::instance_ == 0)
- {
- // We can replace the following lines with this line once we
- // update the macro in OS.h
- // ACE_NEW_RETURN ((ACE_Singleton<TYPE, LOCK>::instance_), TYPE, 0);
-
- instance_ = new TYPE;
- if (instance_ == 0)
- {
- errno = ENOMEM;
- return 0;
- }
- else if (ACE_LOG_MSG->op_status () == -1)
- {
- errno = ACE_LOG_MSG->errnum ();
- delete instance_;
- instance_ = 0;
- return 0;
- }
- }
+ ACE_NEW_RETURN ((ACE_Singleton<TYPE, LOCK>::instance_), TYPE, 0);
}
return ACE_Singleton<TYPE, LOCK>::instance_;