GNOME Bugzilla – Bug 340133
Segmentation Fault on creating GtkClipboard
Last modified: 2006-07-13 11:05:20 UTC
Creating a gtk.Clipboard object more than once produces a segmentation fault.
Created attachment 64534 [details] Code to reproduce the bug The program exits with the following error message: test.py:13: GtkWarning: GtkClipboard prematurely finalized clip = gtk.Clipboard () Segmentation fault
I don't think this is a bug - I think your test program is broken. The Clipboards are destroyed when the get_clip() and set_clip() functions return but the set_text() and request_text() methods set callbacks on those Clipboards which when called find no valid clipboards. Besides it hasn't called gtk.main() to run the mainloop. Try creating a Clipboard that stays around for a while that the funcs can use.
My original application did have a main loop. This code just exhibits the same behaviour. I agree that this is not actually the ideal way to handle the clipboard, but I don't think it should cause python to crash.
*** This bug has been marked as a duplicate of 343960 ***