hey i have this error
The debugged program raised the exception unhandled RuntimeError
"underlying C/C++ object has been deleted"
the code is:
class qthread(QtCore.QThread):
def __init__(self, x, y, z):
self.x=x
self.y=y
self.z=z
self.name=""
self.m=hashlib.md5()
def changeresultsig(self, text):
self.emit(QtCore.SIGNAL("changeresult(text)"),text)
def conssig(self, text):
self.emit(QtCore.SIGNAL("cons(text)"), text)
def enablesig(self):
self.emit(QtCore.SIGNAL("enable("))
def disablesig(self):
self.emit(QtCOre.SIGNAL("disable()"))
def gui(self):
self.emit(QtCore.SIGNAL("gui()"))
def run(self):
self.name="md"+str(z)+".dat"
self.conssig("starting thread "+str(z)+"..")
self.changeresultsig("starting thread "+str(z)+"..")
self.gui()
try:
self.db=anydbm.open(name, "n")
except e:
self.conssig("error openning the database "+self.name+" "+e.reason())
self.changeresultsig("error oppening the database "+str(self.name))
self.enable()
self.gui()
pass
return 1
self.s=string.printable
self.conssigole("setting up...")
self.gui()
while self.x<=self.y:
self.changeresultsig("starting loop..")
self.conssig("starting loop..")
self.gui()
self.it=itertools.product(self.s, reapeat=self.x)
for i in self.it:
self.ij="".join(i)
self.m=hashlib.md5(self.ij)
self.db[self.m.hexdigest()]=self.ij
self.changeresultsig("calculating hash of the string ("+self.ij+") with the hash ("+self.m.hexdigest()+").")
self.gui()
self.db.close()
self.changeresultsig("thread "+str(self.z)+" finished!")
self.conssig("finished!")
self.gui()
th1=qthread(0, 3, 1)
th2=qthread(4, 6, 2)
th3=qthread(7, 9, 3)
th4=qthread(10, 13, 4)
th5=qthread(14, 15, 5)
def connecter():
QtCore.QObject.connect(th1, QtCore.SIGNAL("gui()"), gui)#ERROR line
QtCore.QObject.connect(th2, QtCore.SIGNAL("gui()"), gui)
QtCore.QObject.connect(th3, QtCore.SIGNAL("gui()"), gui)
QtCore.QObject.connect(th4, QtCore.SIGNAL("gui()"), gui)
QtCore.QObject.connect(th5, QtCore.SIGNAL("gui()"), gui)
QtCore.QObject.connect(th1, QtCore.SIGNAL("enable()"), enable)
QtCore.QObject.connect(th2, QtCore.SIGNAL("enable()"), enable)
QtCore.QObject.connect(th3, QtCore.SIGNAL("enable()"), enable)
QtCore.QObject.connect(th4, QtCore.SIGNAL("enable()"), enable)
QtCore.QObject.connect(th5, QtCore.SIGNAL("enable()"), enable)
QtCore.QObject.connect(th1, QtCore.SIGNAL("disable()"), disable)
QtCore.QObject.connect(th2, QtCore.SIGNAL("disable()"), disable)
QtCore.QObject.connect(th3, QtCore.SIGNAL("disable()"), disable)
QtCore.QObject.connect(th4, QtCore.SIGNAL("disable()"), disable)
QtCore.QObject.connect(th5, QtCore.SIGNAL("disable()"), disable)
QtCore.QObject.connect(th1, QtCore.SIGNAL("changeresult()"), changeresult)
QtCore.QObject.connect(th2, QtCore.SIGNAL("changeresult()"), changeresult)
QtCore.QObject.connect(th3, QtCore.SIGNAL("changeresult()"), changeresult)
QtCore.QObject.connect(th4, QtCore.SIGNAL("changeresult()"), changeresult)
QtCore.QObject.connect(th5, QtCore.SIGNAL("changeresult()"), changeresult)
QtCore.QObject.connect(th1, QtCore.SIGNAL("cons()"), cons)
QtCore.QObject.connect(th2, QtCore.SIGNAL("cons()"), cons)
QtCore.QObject.connect(th3, QtCore.SIGNAL("cons()"), cons)
QtCore.QObject.connect(th4, QtCore.SIGNAL("cons()"), cons)
QtCore.QObject.connect(th5, QtCore.SIGNAL("cons()"), cons)
def main():
cons("new session")
cons("setting connecter")
connecter()
cons("disabling GUI")
disable()
gui()
cons("starting threads....")
gui()
th1.start()
th2.start()
th3.start()
th4.start()
th5.start()