[Interest] Destructor appearing twice in the stack trace?

Etienne Sandré-Chardonnal etienne.sandre at m4x.org
Tue Nov 10 08:01:53 CET 2015


Hi,

I have fixed the crash problem, but the double destructor is still there.
For the record, what is the compiler mechanism behind this?

The crash issue was simple : I have three QObjects with parents A -> B -> C
(grandchild)
The C destructor was sending destroyed() signal  to B slot, which was
sending a signal to A's slot, which was deleting B, still a parent of C.
Replacing "delete B" by "B->deleteLater()" fixed it. But the double
destructor in stack is unrelated and still there.

Thanks




2015-11-09 18:19 GMT+01:00 Thiago Macieira <thiago.macieira at intel.com>:

> On Monday 09 November 2015 16:21:44 Etienne Sandré-Chardonnal wrote:
> > Dear all,
> >
> > I am debugging an app which crashes when an object is being deleted. The
> > debuggers halt on a segmentation fault inside QObject destructor. The
> > object deletion was requested by a call to deleteLater()
> >
> > Here is what I get in the stack trace:
> >
> > 0    QObject::~QObject    qobject.cpp    993    0x7ffff62c7580
> > 1    RendererInterface::~RendererInterface    rendererinterface.cpp
> > 119    0x60664f
> > 2    RendererInterface::~RendererInterface    rendererinterface.cpp
> > 137    0x60667e
> > 3    qDeleteInEventHandler    qobject.cpp    4391    0x7ffff62d06e5
> >
> > How is it possible to have the destructor twice in the stack?? At the
> > beginning I was thinking this was a GDB bug (GDB/MinGW under windows is
> > buggy) but I get the same result when compiling the app under linux.
> >
> > Any idea how this can happen?
>
> It depends on what code the compiler generated. It's entirely possible,
> but I
> can't also rule out a problem.
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20151110/0e07de67/attachment.html>


More information about the Interest mailing list