[Fxruby-users] segfault in GC::start after accessing verticalScrollbar.position from overloaded move
Status: Inactive
Brought to you by:
lyle
From: Oliver S. <ol...@mo...> - 2004-04-25 16:09:27
|
(sorry Lyle, forgot to switch addresses the first time :) Hello, I'm trying to bypass a bug in FXScintilla which causes the widget to scroll up forever when you try to scroll with a mouse wheel, and I figured out through trial and error that if I subclass FXScintilla (which is a subclass of FXScrollArea), overload moveContents and reimplement it with the following: def moveContents(new_x, new_y) old_position = verticalScrollbar.position super verticalScrollbar.position = old_position end the erratic behavior goes away. I thought I was pretty clever for a while, but now it turns out that I'm getting a weird segfault when I initiate garbage collection later in my program. I can play around with the code in other ways to make it appear or disappear, but it seems to be pretty hard to pin down. I'm guessing that the ruby garbage collector thinks it needs to free verticalScrollbar, and the segfault occurs because the C++ destructor has already taken care of it? If I comment out the two lines that access verticalScrollbar, it starts working. If I call the same two lines outside of the overloaded moveContents, no segfault (but of course the original bug is still there). Any ideas? If I'm not supposed to be overloading moveContents or accessing verticalScrollbar.position, is there another way to accomplish the same effect? Thanks, Oliver Smith |