-
-
Notifications
You must be signed in to change notification settings - Fork 347
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, prevent corrupt database, fix typos in qml #731
base: master
Are you sure you want to change the base?
Conversation
There's an issue with clang-format, apparently it wants to format
into
Investigating 🤔 EDIT: fixed locally by updating clang-format based on these instructions: https://bugreports.qt.io/browse/QTCREATORBUG-31858, but the action still fails, likely because the Github Action uses clang-format v18, where this bug occurs. I changed the ci/cd to always run all jobs, even if linting fails. @guihkx can you take a look at those changes? |
00aa5ab
to
be52e59
Compare
Not a big fan of that tbh... Can you try downgrading the runner used in the "Code Linting" job to As for the other changes, I'm not on my Linux machine right now to test this properly, but I will do that as soon as I can. |
0f2daee
to
68e3866
Compare
@guihkx Done, it worked! There's a problem with the snap build, seems like an authentication issue. @nuttyartist can you take a look? |
Nice.
Hmm, I actually think that error comes from Do you wanna try to also use It looks like the recent upgrade of Note to self: actions/runner-images#9932 |
Thanks, @zjeffer! I want to take some time to review this, hopefully today. |
src/treeviewlogic.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes to this file are fine, I guess, but I can still reproduce the database corruption of #504 by following these reproduction steps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't reproduce it anymore with those steps. Step 4 logs onMoveNodeRequested Can't move a node into the same parent
in the console, indicating it won't try to move it into itself (which caused the bug).
Did you test it on a clean database?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test it on a clean database?
Yup. I'm not sure why you can't reproduce it, but here's a video if it helps:
broken.mp4
I also didn't do all steps because my terminal was already being spammed with qt.sql.qsqlquery: QSqlQuery::value: not positioned on a valid record
at only step 2, and by then the db is already broken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, we're seeing 2 different bugs. The bug I fixed in this PR occured when moving a non-empty node into the folder it's already in. The bug you're triggering in your video happens when moving an empty note into a folder. It does indeed also trigger the same problem where folders then can't be deleted.
I'll look into that bug in another PR.
2524ce1
to
0306add
Compare
028bd4d
to
a466805
Compare
…oving a note into the same folder it was already in
a466805
to
2c85e61
Compare
I added an option to CMakeLists.txt to enable address sanitizer (first commit). I ran it and noticed the following memory leak when closing the main window:
It's not much but it should be fixed either way, so I did that in the second commit. We have lots more (and much bigger) memory leaks btw, will take a look at the others too.
In the third commit, I just fixed some typos in qml files.
In the fourth commit, I ensured that #504 can never happen again, by simply returning if the user tries to move a note into the same folder that it's already in. I followed @guihkx steps and could not reproduce the issue after this commit.
Closes #504
Closes #234