Uploaded image for project: 'Log4cxx'
  1. Log4cxx
  2. LOGCXX-532

Static objects and deleting

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      As seen in LOGCXX-430 and LOGCXX-322, making sure that when an application terminates earlier than expected we don't crash is rather hard to do.

      I came across this solution when researching this problem:
      https://stackoverflow.com/a/470545/624483

      My thought is that we create something like a log4cxx::Globals class, which contains a smart pointer to everything that must be kept alive before the library can safely be unloaded. In each thread, you would do something like:

      GlobalsPtr globals = log4cxx::globals;
      thus ensuring that the destructor can't run before all of the threads are stopped. This would be up to the user of the library.

      Attachments

        Issue Links

          Activity

            People

              rmiddleton Robert Middleton
              rmiddleton Robert Middleton
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: