poco icon indicating copy to clipboard operation
poco copied to clipboard

Global static objects (de)initialization

Open aleks-f opened this issue 6 years ago • 3 comments

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

aleks-f avatar Apr 02 '18 16:04 aleks-f

My choice is for all global statics in a single file (Static.cpp/h, Global.cpp/h, ... ?)

zosrothko avatar Apr 05 '18 06:04 zosrothko

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.

obiltschnig avatar Apr 05 '18 07:04 obiltschnig

This issue is stale because it has been open for 365 days with no activity.

github-actions[bot] avatar Aug 26 '22 03:08 github-actions[bot]

This issue was closed because it has been inactive for 60 days since being marked as stale.

github-actions[bot] avatar Jan 02 '23 02:01 github-actions[bot]