Anonymous - 2011-02-13

Hi,

i tried to run a lightblue-connection in a PyQtThread.
But i am getting the following Error-Message:

2011-02-13 23:23:33.285 Python[1113:4b03] *** __NSAutoreleaseNoPool(): Object 0x1038ad3e0 of class __NSCFDate autoreleased with no pool in place - just leaking

This is just some example-code…

from PyQt4 import QtCore,QtGui
import time, sys, lightblue
class Listener(QtGui.QWidget):
    def __init__(self, parent =None):
        QtGui.QWidget.__init__(self, parent)
        
        #setting up the main window
        self.setGeometry(300,300, 200,200)
        self.setStyleSheet("QWidget { background-color: white }" )
        self.setWindowTitle('NSAutoReleasePool')
        #setting up a label
        self.user_guide = QtGui.QLabel()
        self.user_guide.move(10, 10)
        self.user_guide.setText("Print some stuff")
        
        hbox = QtGui.QHBoxLayout()
        hbox.addWidget(self.user_guide)
        
        vbox = QtGui.QVBoxLayout()
   
        vbox.addLayout(hbox)
        self.setLayout(vbox)
        self.thread = Sender()
        self.connect(self.thread, QtCore.SIGNAL("test(QString)"), self.user_guide.setText)
        self.thread.start()

        
class Sender(QtCore.QThread):
    def __init__(self, parent =None):
        QtCore.QThread.__init__(self, parent)
        
    def run(self):
        t = '.'
        devs = lightblue.finddevices(getnames=True, length=5)
        for i in range(5):
            
            time.sleep(1)
            self.emit(QtCore.SIGNAL('test(QString)'),"I am running " +t)
            t += '.'
        self.emit(QtCore.SIGNAL('test(QString)'),"I am finished")
app = QtGui.QApplication(sys.argv)
acc_widget = Listener()
acc_widget.show()
sys.exit(app.exec_())