From: Michael Andres Date: Thu, 4 Oct 2007 06:52:59 +0000 (+0000) Subject: moved static instance into function X-Git-Tag: BASE-SuSE-Linux-11_0-Branch~740 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fe625628056cde6c4b5fdbb15733513a89fe56dc;p=platform%2Fupstream%2Flibzypp.git moved static instance into function --- diff --git a/zypp/capability/NullCap.cc b/zypp/capability/NullCap.cc index b9f31cc..9dd7ddc 100644 --- a/zypp/capability/NullCap.cc +++ b/zypp/capability/NullCap.cc @@ -11,8 +11,6 @@ */ #include "zypp/capability/NullCap.h" -using namespace std; - /////////////////////////////////////////////////////////////////// namespace zypp { ///////////////////////////////////////////////////////////////// @@ -20,18 +18,13 @@ namespace zypp namespace capability { ///////////////////////////////////////////////////////////////// - CapabilityImpl_Ptr NullCap::_instance; - - /////////////////////////////////////////////////////////////////// - NullCap::NullCap() : CapabilityImpl( Resolvable::Kind() ) // no Kind! {} CapabilityImpl_Ptr NullCap::instance() { - if ( ! _instance ) - _instance = new NullCap; + static CapabilityImpl_Ptr _instance( new NullCap ); return _instance; } diff --git a/zypp/capability/NullCap.h b/zypp/capability/NullCap.h index 07c100e..18157dc 100644 --- a/zypp/capability/NullCap.h +++ b/zypp/capability/NullCap.h @@ -56,10 +56,6 @@ namespace zypp /** Empty string. */ virtual std::string encode() const; - - private: - /** Singleton */ - static CapabilityImpl_Ptr _instance; }; ///////////////////////////////////////////////////////////////////