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

helpers/object.h: DECLARE_LOG4CXX_OBJECT macro definition is missing virtual destructor declaration

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 0.9.7, 0.10.0
    • 0.10.0
    • None
    • None
    • log4cxx 0.9.7 on Linux

    Description

      Hi,
      the macro DECLARE_LOG4CXX_OBJECT declares a new class with a virtual function, but doesn't declare a virtual destructor. gcc 3.2.3 complains this...

      The following is the new macro definition fixing the bug (for the code in CVS head):
      #define DECLARE_LOG4CXX_OBJECT(object)\
      public:\
      class Class##object : public helpers::Class\
      {\
      public:\
      Class##object() : helpers::Class() {}\
      virtual ~Class##object() {}\
      virtual const log4cxx::logchar* getName() const

      { return LOG4CXX_STR(#object); }

      \
      virtual helpers::ObjectPtr newInstance() const\

      {\ return new object();\ }

      \
      };\

      The DECLARE_ABSTRACT_LOG4CXX_OBJECT macro has the same problem, but only in CVS head, not in 0.9.7.

      Attachments

        Activity

          People

            carnold@apache.org Curt Arnold
            oliverstraub Marc-Oliver Straub
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: