GNOME Bugzilla – Bug 618454
Seed is unable to use HashTables as parameters or return values
Last modified: 2013-02-14 02:16:49 UTC
So if I want to use API such as this, it doesn't work: var message = new Soup.Message(); message.request_headers.set_content_type('text/plain', { 'charset' : 'UTF-8' });
Created attachment 160903 [details] [review] first cut implementation
It needs memory management fixing - It's probably worth commiting in as is, and keeping this bug open as 'hashtables need memory fixing' should really use: g_hash_table_new_full -- to create the has table, and add hooks to free the keys.. values are a bit more complex.......... adding gobject's I think we need to ref them. and unref on destruction. add g_hash_table_destroy to seed_release_arg
Created attachment 235933 [details] [review] [PATCH] implement hashtables conversion between js and gi values I updated Gustavo's patch: - rebase on master and update with new code - use g_hash_table_new_full to free the keys - free the hash table's values and the hash table itself in seed_release_arg. Tests: - I only tested GHashTable(utf8, utf8) - I only tested "in" parameter with "transfer-none" => In this case, it is freed correctly. My use case was: Soup.form_request_new_from_hash('GET', 'http://foo', {'s': 'foo', 'f': 'bar'});
I'm closing for now (as the patch is applied) I guess if someone finds a non 'transfer-none' situation, and it leaks they can file a new bug...