Fixed initialization of static vars.
[platform/upstream/libzypp.git] / zypp / Dependencies.cc
index 98ffdde..8234cdf 100644 (file)
@@ -49,11 +49,10 @@ namespace zypp
   public:
     /** Offer default Impl. */
     static shared_ptr<Impl> nullimpl()
-    { if ( ! _nullimpl ) _nullimpl.reset( new Impl ); return _nullimpl; }
-
-  private:
-    /** Default Impl: empty sets. */
-    static shared_ptr<Impl> _nullimpl;
+    {
+      static shared_ptr<Impl> _nullimpl( new Impl );
+      return _nullimpl;
+    }
 
   private:
     friend Impl * rwcowClone<Impl>( const Impl * rhs );
@@ -63,10 +62,6 @@ namespace zypp
   };
   ///////////////////////////////////////////////////////////////////
 
-  shared_ptr<Dependencies::Impl> Dependencies::Impl::_nullimpl;
-
-  ///////////////////////////////////////////////////////////////////
-
   /** \relates DependenciesImpl Stream output */
   inline std::ostream & operator<<( std::ostream & str, const Dependencies::Impl & obj )
   {