SimpleTest no longer builds because of its public destructor

RESOLVED DUPLICATE of bug 1060984

Status

Toolkit Graveyard
XULRunner
RESOLVED DUPLICATE of bug 1060984
3 years ago
2 years ago

People

(Reporter: Gijs, Assigned: Gijs)

Tracking

Trunk
x86
Mac OS X

Details

Attachments

(1 attachment)

From:

http://ftp.mozilla.org/pub/mozilla.org/xulrunner/tinderbox-builds/mozilla-aurora-macosx64/latest/mozilla-aurora-macosx64-xulrunner-nightly-bm84-build1-build133.txt.gz

/builds/slave/m-aurora-osx64-xr-ntly-0000000/build/xulrunner/examples/simple/components/src/SimpleTest.cpp:17:1: error: static_assert failed "Reference-counted class SimpleTest should not have a public destructor. Try to make this class's destructor non-public. If that is really not possible, you can whitelist this class by providing a HasDangerousPublicDestructor specialization for it."
NS_IMPL_ISUPPORTS(SimpleTest, nsISimpleTest)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../dist/include/nsISupportsImpl.h:1025:3: note: expanded from macro 'NS_IMPL_ISUPPORTS'
  NS_IMPL_ADDREF(aClass)                                                      \
  ^~~~~~~~~~~~~~~~~~~~~~
../../../../../dist/include/nsISupportsImpl.h:559:3: note: expanded from macro 'NS_IMPL_ADDREF'
  MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(_class)                                  \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../dist/include/nsISupportsImpl.h:91:3: note: expanded from macro 'MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING'
  static_assert(!MOZ_IS_DESTRUCTIBLE(X) || \
  ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/builds/slave/m-aurora-osx64-xr-ntly-0000000/build/xulrunner/examples/simple/components/src/SimpleTest.cpp:17:1: warning: delete called on 'SimpleTest' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
../../../../../dist/include/nsISupportsImpl.h:1026:3: note: expanded from macro 'NS_IMPL_ISUPPORTS'
  NS_IMPL_RELEASE(aClass)                                                     \
  ^
../../../../../dist/include/nsISupportsImpl.h:634:40: note: expanded from macro 'NS_IMPL_RELEASE'
  NS_IMPL_RELEASE_WITH_DESTROY(_class, delete (this))
                                       ^
../../../../../dist/include/nsISupportsImpl.h:614:5: note: expanded from macro 'NS_IMPL_RELEASE_WITH_DESTROY'
    _destroy;                                                                 \
    ^
1 warning and 1 error generated.
make[6]: *** [SimpleTest.o] Error 1
make[5]: *** [xulrunner/examples/simple/components/src/compile] Error 2
make[5]: *** Waiting for unfinished jobs....
status-firefox34: affected → ?
Created attachment 8481783 [details] [diff] [review]
add private virtual destructor to SimpleTest so it compiles again,

After reading about virtual destructors and so on for a bit, I *think* this is the correct fix?
Attachment #8481783 - Flags: review?(benjamin)
Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
status-firefox34: ? → affected
Summary: SimpleTest no longer builds because of its public constructor → SimpleTest no longer builds because of its public destructor

Updated

3 years ago
Attachment #8481783 - Flags: review?(benjamin) → review+
Hey look, someone else realized, as we were uplifting to beta... :-\
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1060984
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.