Commit commands must be within a sqlLock

This commit is contained in:
Jonathan Warren 2013-05-16 12:41:04 -04:00
parent 5cf30c1533
commit 17a8ece5c1
2 changed files with 6 additions and 1 deletions

View File

@ -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:

View File

@ -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()