Mercurial > octave
changeset 28352:60f3b8702ab7 stable
revert part of changeset 00a9a49c7670
After changeset 00a9a49c7670, the following test was failing because
properties were not always updated immediately after deletion.
hf = figure ("visible", "off");
hax = axes ("parent", hf);
hctx1 = uicontextmenu ("parent", hf);
hctx2 = uicontextmenu ("parent", hf);
set (hf, "uicontextmenu", hctx2);
delete (hctx2);
assert (get (hf, "uicontextmenu"), []);
* ObjectProxy.cc (ObjectProxy::finalize): Use BlockingQueuedConnection
for cross-thread connection to invoke Object::slotFinalize method.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 23 May 2020 07:41:29 -0400 |
parents | 2a4c4c7dfc88 |
children | ec764709312e 938b234f395a |
files | libgui/graphics/ObjectProxy.cc |
diffstat | 1 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/graphics/ObjectProxy.cc Fri May 22 18:47:16 2020 -0400 +++ b/libgui/graphics/ObjectProxy.cc Sat May 23 07:41:29 2020 -0400 @@ -100,7 +100,15 @@ void ObjectProxy::finalize (void) { - emit sendFinalize (); + if (! m_object) + return; + + Qt::ConnectionType t = Qt::BlockingQueuedConnection; + + if (QThread::currentThread () == QCoreApplication::instance ()->thread ()) + t = Qt::DirectConnection; + + QMetaObject::invokeMethod (m_object, "slotFinalize", t); } void