Skip to content

Fix uninitialized value memory error - #793

Merged
justinclift merged 1 commit into
sqlitebrowser:masterfrom
revolter:hotfix/uninitialized-value
Oct 4, 2016
Merged

justinclift merged 1 commit into
sqlitebrowser:masterfrom
revolter:hotfix/uninitialized-value

Conversation

@revolter

@revolter revolter commented Oct 1, 2016

Copy link
Copy Markdown
Member

While profiling using Valgrind, two uninitialized value errors popped up,
because the dataSource iVar was used in the if check from the editTextChanged
function before initializing it. This commit moves the dataSource
initializations before any other calls.

@sqlitebrowser/developers, Do you think this can cause other problems?

While profiling using Valgrind, two uninitialized value errors popped up,
because the dataSource iVar was used in the if check from the editTextChanged
function before initializing it. This commit moves the dataSource
initializations before any other calls.
Comment thread src/EditDialog.cpp

// Empty the text editor contents, then enable text editing
ui->editorText->clear();
ui->editorText->setEnabled(true);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This caused the error, as it indirectly calls the editTextChanged function, but changed all of them as it's safer.

@justinclift justinclift added the bug Confirmed bugs or reports that are very likely to be bugs. label Oct 4, 2016
@justinclift

Copy link
Copy Markdown
Member

Tested this on my OSX desktop. Doesn't seem to have any weird side effects, so going to merge it. 😄

@justinclift
justinclift merged commit 2bdd71a into sqlitebrowser:master Oct 4, 2016
vtronko pushed a commit that referenced this pull request Dec 29, 2016
While profiling using Valgrind, two uninitialized value errors popped up,
because the dataSource iVar was used in the if check from the editTextChanged
function before initializing it. This commit moves the dataSource
initializations before any other calls.
@revolter
revolter deleted the hotfix/uninitialized-value branch May 30, 2018 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Confirmed bugs or reports that are very likely to be bugs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants