poco
poco copied to clipboard
Global static objects (de)initialization
We should put these under control by either one of these two methods:
- Schwarz counter
- all global statics in a single file (Static.cpp/h, Global.cpp/h, ... ?)
I have a reference counting memory leak detector (not yet committed at the time of this posting) that works (only if explicitly enabled in Config.h
, otherwise non-existent) without any intervention in code, but gets heavily polluted with false positives because of undefined de-initialization order (Logger
, ThreadPool
, there may be other offenders).
@obiltschnig
My choice is for all global statics in a single file (Static.cpp/h, Global.cpp/h, ... ?)
We already have a library-specific header in every library, e.g. Foundation.h, XML.h, Util.h, etc. Statics could go in a matching .cpp, e.g. Foundation.cpp, XML.cpp, etc. One drawback of this is that it may cause inclusion of otherwise unneeded code in statically linked applications. However, since there aren't that many statics, this is a minor concern.
This issue is stale because it has been open for 365 days with no activity.
This issue was closed because it has been inactive for 60 days since being marked as stale.