0

I encounter a strange issue when closing a PyGTK application. This is the function used to quit the program:

def quit(self, obj=None, event=None):
        gtk.main_quit()
        os._exit(0)

When this function is called, the application's window remain on screen, but the GUI is frozen. In the terminal emulator I am returned to the prompt line while in the task manager the Python process is still running (using about 900k of RAM memory). I have to kill the python process to make the window dissapear.

What's happening? I should mention that I use threads and the application creates a HTTP server using SimpleHTTPServer and SocketServer .

ov1d1u
  • 958
  • 1
  • 17
  • 38

1 Answers1

2

If you use the .serve_forever() method of the SocketServer, you should probably call .shutdown() in quit.

Valentin Lorentz
  • 9,556
  • 6
  • 47
  • 69