GNOME Bugzilla – Bug 546450
Troubles with dynamic DBus.Object and string [][]
Last modified: 2008-08-06 14:54:21 UTC
These string[][] problems are making any "aas" reply not usable in Vala: Async situation: error: internal error: duplicating string[] instances not yet supported private void on_get_stats (string [][] items, GLib.Error e) { ^^^^^^^^^^^^^^^^^ private void on_get_stats (string [][] items, GLib.Error e) { foreach (string [] pair in items) { print ("k:" + pair[0] + " v:" + pair[1] + "\n"); } } Facade.Instance().tracker.GetStats (on_get_stats); Non-async situation: error: internal error: duplicating string[] instances not yet supported string[][] tags; dynamic DBus.Object tracker = ... private void get_numbers () { string[][] tags; tracker.GetStats (); foreach (string [] pair in tags) { print ("k:" + pair[0] + " v:" + pair[1] + "\n"); } } Weak strings, non-async: Segmentation fault (core dumped) dynamic DBus.Object tracker = ... private void get_numbers () { string[][] tags; tracker.GetStats (); foreach (weak string [] pair in tags) { print ("k:" + pair[0] + " v:" + pair[1] + "\n"); } }
You certainly need to use weak for now, I'll fix the crash.
2008-08-06 Jürg Billeter <j@bitron.ch> * gobject/valaccodegenerator.vala: Fix crash when using foreach with stacked arrays, fixes bug 546450 Fixed in r1736.
Sorry, but this case is not yet fixed: Async situation: error: internal error: duplicating string[] instances not yet supported private void on_get_stats (string [][] items, GLib.Error e) { ^^^^^^^^^^^^^^^^^ private void on_get_stats (string [][] items, GLib.Error e) { foreach (string [] pair in items) { print ("k:" + pair[0] + " v:" + pair[1] + "\n"); } } Facade.Instance().tracker.GetStats (on_get_stats); Reopening. Although it's not a blocker for me anymore. Thanks for the crash-fix!
Cloned bug as requested on IRC Closing this one