Example of finding group and pref by name: ```C StashGroup *group = stash_group_get_group_by_name("cup"); if (group) { StashPref *pref = stash_group_get_pref_by_name(group, "price"); if (pref) { msgwin_status_add("%s.%s = %f", group->name, pref->key_name, *(gdouble *)pref->setting); } else { msgwin_status_add("pref not found"); } } else { msgwin_status_add("group not found"); } ```
Problem: Doesn't work if used after `stash_group_free()`.
In addition to reviewing memory management... Some potential solutions: * Rewrite "free" to defer actual deallocation until Geany is being shutdown. Pro: Minimize changes to existing code, maybe. Con: "free" doesn't do what it says it will. * Rewrite code to defer deallocation until Geany is being shutdown. Pro: "free" does what it says it will. Con: Probably will require extensive changes to existing code. * Replace "free" with "free_later" (or some such). Pro: "free" and "free_later" do what they say they will. Just need to replace "free" with "free_later" in existing code. Con: Use of "free" can still prevent the lookup from working.