Skip to content
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

delete the objects owned by the widget #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alcantara09
Copy link

No description provided.

Vizkit3DWidget::~Vizkit3DWidget()
{
delete env_plugin;
env_plugin = NULL;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you're using C++ >= 11, use nullptr instead of NULL.

@doudou
Copy link

doudou commented Jan 16, 2019

Vizkit3DWidget sets its plugin parent (as QObject parent) to itself here: https://github.com/rock-core/gui-vizkit3d/blob/master/src/Vizkit3DWidget.cpp#L751

Qt will therefore delete the plugin when their parent (the vizkit3dWidget) gets deleted, and this is not needed.

@doudou
Copy link

doudou commented Jan 16, 2019

Since there is a difference in behavior between explicit deletion and letting-Qt-doing-it, there's something else that's fishy. Let's leave this PR open until we figure out what it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants