If you have the opportunity tu run a leak detector on this it might be interesting, although given the info here I'm wondering if it's not something outside geany that interferes (any kind of program that hook into others). Or one of the support libraries, maybe GTK has a bad leak in the drawing code on some specific situations?