From: Andy S. <laz...@gm...> - 2010-10-23 19:05:17
|
John Obbele <joh...@gm...> writes: > On Sat, Oct 23, 2010 at 07:09:48PM +0800, Andy Stewart wrote: >> > So for now come new modifications to gio attached to this mail. >> > Let me know if you prefer one whole patch or something else. >> Thanks for patches, i have apply those patches except modified for >> fileEnumeratorNextFile >> >> >From GTK+ document, it's should use wrapNewGObject unref FileInfo, but i >> got "Segmentation fault" in demo/FileManager.hs after i apply this >> patch. > > First a good news: I can compile it too. > Then a bad news: I can't understand why the application segfaults. > > I've checked the behaviour in C where GtkFile/GtkFileInfo objects > can be unref'ed withtout any problems, so the documentation was > fine. I suspect the problem to be in the use of both > "unsafePerformIO" and "wrapNewGObject" many times in > gio/System/GIO/File/File.chs. I think this is have internal trick in GIO C code that will break if we use wrapNewGObject in fileEnumeratorNextFile But makeNewGObject always works, so let's keep makeNewGObject. > > It seems strange to me that we use unsafePerformIO on the Glib > objects ... but honestly I don't really know, it's perhaps due to > another thing. > > Attached is another example causing segfault, which does not use > fileEnumeratorNextFile. I have test your attached, works fine, no segfault. > > The best option should be to remove all the patches to GIO and wait > until someone figure out the issue. I suggest we keep makeNewGObject here and don't need remove all your other patches, i have test, works fine. Cheers, -- Andy |