Simple Gtk.Window test leaks on Windows 7 x64
Submitted by lovetox
Link to original bug (#784710)
Description
This code leaks pretty badly, i think it has to do with inheriting from Gtk.Window.
Is there something wrong with my code? I couldnt reproduce this on Linux.
This is with GTK+ 3.22.16 PyGobject 3.24.1 Windows 7 x64 Python 3.6
import sys
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gio
from gi.repository import Gtk, GLib
class App(Gtk.Application):
def __init__(self):
Gtk.Application.__init__(self,
application_id="org.gnome.example",
flags=Gio.ApplicationFlags.FLAGS_NONE)
def do_activate(self):
window = Gtk.ApplicationWindow(application=self)
grid = Gtk.Grid()
button = Gtk.Button('Start')
button.connect('clicked', self.on_button_clicked)
grid.add(button)
window.add(grid)
window.show_all()
def on_button_clicked(self, *args):
for x in range(100):
TestWin()
class TestWin(Gtk.Window):
def __init__(self):
super(Gtk.Window, self).__init__()
self.show()
GLib.timeout_add_seconds(1, self.destroy)
if __name__ == '__main__':
app = App()
app.run(sys.argv)
Edited by Christoph Reiter