-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Null pointer on connecting nodes in certain examples #441
Comments
That's on Qt 6.7.2 in Microsoft Windows (and seen on two different computers btw). |
OK, so it seems to behave if I just make sure the Root cause seems to be line 91, in the method Think we can fix this without too much bother then. |
Slightly better, let's suggest this
|
Fixed NULL pointer exception on connecting nodes (paceholder#441)
If embedQWidget() is called multiple time you continue to allocate a new QGraphicsProxyWidget. It should be included a guard at least to destroy the previous pointer. |
|
When assigning new pointer for _proxyWidget (issue paceholder#441), only do so if the pointer is NULL. Otherwise we repeatedly create new and leave the existing hanging if the method is called multiple times.
Good point. Fixed. |
Thanks for addressing it. It's been recently added in 77f3ad1 . |
In some of the examples, e.g. the calculator, there is a crash because of a null ProxyWidget pointer in places like this in NodeGraphicsObject.cpp line 81:
void NodeGraphicsObject::updateQWidgetEmbedPos()
{
_proxyWidget->setPos(nodeScene()->nodeGeometry().widgetPosition(_nodeId));
}
I might try and fix that by simply testing the pointer for NULL before it is dereferenced, but thought it wise to consult you first.
The text was updated successfully, but these errors were encountered: