John Obbele <john.obb...@gmail.com> 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 ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ Gtk2hs-devel mailing list Gtk2hs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel