spa-json: rename _from_string() to _wrap_string() and add new "from" variants
The previous naming convention was confusing because it did not make it explicit that the string is not being copied. We had this wrong already in the Lua bindings and thanks to some miracle it hasn't backfired so far (it was using the "wrap" behaviour with a string that doesn't stay alive). In some places we actually need the "copy" behaviour and in some other places we need the "wrap" behaviour, so let's have both variants available.
This commit is contained in:
@@ -29,7 +29,7 @@ match_rules_cb (void *data, const char *location, const char *action,
|
||||
const char *str, size_t len)
|
||||
{
|
||||
struct match_rules_cb_data *cb_data = data;
|
||||
g_autoptr (WpSpaJson) json = wp_spa_json_new_from_stringn (str, len);
|
||||
g_autoptr (WpSpaJson) json = wp_spa_json_new_wrap_stringn (str, len);
|
||||
return cb_data->callback (cb_data->data, action, json, cb_data->error) ? 0 : -EPIPE;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user