Kaydet (Commit) ec1b60d6 authored tarafından Caolán McNamara's avatar Caolán McNamara

make this a non-leaky singleton

üst feeab468
...@@ -122,20 +122,16 @@ private: ...@@ -122,20 +122,16 @@ private:
//========================================================================= //=========================================================================
#define SFX_DECL_OBJECTFACTORY() \ #define SFX_DECL_OBJECTFACTORY() \
private: \
static SfxObjectFactory* pObjectFactory; \
public: \ public: \
static SfxObjectFactory& Factory(); \ static SfxObjectFactory& Factory(); \
virtual SfxObjectFactory& GetFactory() const { return Factory(); } virtual SfxObjectFactory& GetFactory() const { return Factory(); }
#define SFX_IMPL_OBJECTFACTORY(ClassName,GlobName,Flags,ShortName) \ #define SFX_IMPL_OBJECTFACTORY(ClassName,GlobName,Flags,ShortName) \
SfxObjectFactory* ClassName::pObjectFactory = 0; \ SfxObjectFactory& ClassName::Factory() \
SfxObjectFactory& ClassName::Factory() \ { \
{ if (!pObjectFactory) \ static SfxObjectFactory aObjectFactory(GlobName, Flags, ShortName); \
pObjectFactory = \ return aObjectFactory; \
new SfxObjectFactory( GlobName, Flags, ShortName ); \ }
return *pObjectFactory; \
}
#endif // #ifndef _SFX_OBJFAC_HXX #endif // #ifndef _SFX_OBJFAC_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment