Tim van der Leeuw wrote:
> Hi Werner,
> On Mon, May 26, 2008 at 4:47 PM, Werner F. Bruhin
> <werner.bruhin@... <mailto:werner.bruhin@...>> wrote:
> I changed my application which in the past packaged fine with py2exe,
> but now I see a problem that the exe does not shutdown, i.e. in
> Task Manager the process is still showing, also all frames/dialogs
> (wxPython based GUI) are closed.
> This likely means that there is some thread in the application which
> is still active. Try enumerating all threads in the system with
> threading.enumerate() after quitting your main-loop, and printing to
> std-out or a logfile the names of all threads and some properties of
> them (such as daemon-thread yes/no).
> If you're out of luck the thread is not created with the threading
> module however, but with the ancient thread module or some C library.
> In that case I don't know how to list all active threads of the
> application; you'd have to use Win32 specific calls. Perhaps you can
> attach some sort of debugger?
> What might also help is to call sys.exit() after the main-loop has
I have tried this, but it did not help.
The problems seems to have to do with sqlalchemy, if I only close the
database sessions then it hangs, I have to do:
self.engine = db.sa.create_engine(dburl, encoding='utf8', echo=False)
self.Session = db.sao.sessionmaker(autoflush=True, transactional=True)
self.ds = self.Session()
... application does whatever and then on close I do
# if I don't do the del's app does not close
I am checking with the SA list why this is necessary, I probably am
doing something wrong somewhere along the lines.
Anyhow thanks for the tips.