Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

revolter
Copy link
Member

@revolter revolter commented Oct 1, 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.

@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.
@@ -94,38 +94,44 @@ void EditDialog::loadData(const QByteArray& data)
case Null:
switch (editMode) {
case TextEditor:
// The text widget buffer is now the main data source
dataSource = TextBuffer;

// Empty the text editor contents, then enable text editing
ui->editorText->clear();
ui->editorText->setEnabled(true);
Copy link
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
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