From 17a8ece5c1bf976aeeb4d5865f818f3a96822e47 Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Thu, 16 May 2013 12:41:04 -0400 Subject: [PATCH] Commit commands must be within a sqlLock --- src/bitmessageqt/__init__.py | 4 ++++ src/shared.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 2b68179f..86ac868f 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -1744,7 +1744,9 @@ class MyForm(QtGui.QMainWindow): self.ui.textEditInboxMessage.setText("") self.ui.tableWidgetInbox.removeRow(currentRow) self.statusBar().showMessage('Moved items to trash. There is no user interface to view your trash, but it is still on disk if you are desperate to get it back.') + shared.sqlLock.acquire() shared.sqlSubmitQueue.put('commit') + shared.sqlLock.release() if currentRow == 0: self.ui.tableWidgetInbox.selectRow(currentRow) else: @@ -1764,7 +1766,9 @@ class MyForm(QtGui.QMainWindow): self.ui.textEditSentMessage.setPlainText("") self.ui.tableWidgetSent.removeRow(currentRow) self.statusBar().showMessage('Moved items to trash. There is no user interface to view your trash, but it is still on disk if you are desperate to get it back.') + shared.sqlLock.acquire() shared.sqlSubmitQueue.put('commit') + shared.sqlLock.release() if currentRow == 0: self.ui.tableWidgetSent.selectRow(currentRow) else: diff --git a/src/shared.py b/src/shared.py index ed1baf22..a5f635ea 100644 --- a/src/shared.py +++ b/src/shared.py @@ -167,11 +167,12 @@ def doCleanShutdown(): sqlSubmitQueue.put('SELECT address FROM subscriptions') sqlSubmitQueue.put('') sqlReturnQueue.get() + sqlSubmitQueue.put('exit') sqlLock.release() printLock.acquire() print 'Finished flushing inventory.' printLock.release() - sqlSubmitQueue.put('exit') + if safeConfigGetBoolean('bitmessagesettings','daemon'): printLock.acquire()