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

Fix memory leak in CDockContainerWidget::restoreState #576

Merged
merged 1 commit into from
Nov 4, 2023

Conversation

gafusss
Copy link

@gafusss gafusss commented Nov 3, 2023

delete old root splitter layout item

delete old root splitter layout item
@githubuser0xFFFF
Copy link
Owner

Thank you

@githubuser0xFFFF githubuser0xFFFF merged commit 40beef9 into githubuser0xFFFF:master Nov 4, 2023
1 check passed
@iam-peter
Copy link

iam-peter commented Nov 24, 2023

There is also a potential memory leak here?
DockContainerWidget.cpp:592

if (!TargetAreaSplitter)
{
    QSplitter* Splitter = newSplitter(InsertParam.orientation());
    Layout->replaceWidget(TargetArea, Splitter);
    Splitter->addWidget(TargetArea);
    updateSplitterHandles(Splitter);
    TargetAreaSplitter = Splitter;
}

@githubuser0xFFFF
Copy link
Owner

@iam-peter You might be right. The code looks similar to the fixed one. @gafusss What do you think?

@gafusss
Copy link
Author

gafusss commented Nov 25, 2023

@iam-peter You might be right. The code looks similar to the fixed one. @gafusss What do you think?

Looks like it, but I can't figure out how to reproduce it to test

@githubuser0xFFFF
Copy link
Owner

@iam-peter I removed the code in DockContainerWidget.cpp:592 because it was dead code. A DockArea always has a parent splitter. So there is no memory leak.

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

Successfully merging this pull request may close these issues.

3 participants