Breaking while loop from on_destroy





I'm taking pictures from an industrial camera within a loop to make it a continuous live display. The images are attached to an Image-widget. Works fine, but when the main program window is closed by the user I want to free the resources used by the camera in the while loop. There are a lot of buffers and data structures that need clean up there. Problem is, I don't know how to interrupt the picture taking while loop. I tried using a variable, e.g.  while (grabbing) {pic = TakePicture(); ...} setting the grabbing variable to false from the on_destroy callback but this is never registered from the camera while loop. Maybe GTK runs the picture taking in another process? How can I solve this in any other way?

/Paul


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]