GNOME Bugzilla – Bug 789323
memory leak, can't locate sub element
Last modified: 2017-12-13 18:30:02 UTC
Created attachment 362058 [details] Sample program My main issue is that librsvg seems to not find sub elements by id. Specifically, rsvg_handle_has_sub returns false, and therefore querying for the element's size and position fails. I'm probably doing something wrong here... or is this a bug? I really want the ability to access sub-elements size and position (by id or name or something along these lines), so any advice/workaround to make this work would be appreciated. The secondary issue is that librsvg causes memory leaks, or at least causes valgrind to think there are leaks, even for a minimal program (creating, writing into, closing, and destroying an RSVG handle). I can easily work around this with a suppression file, but... Is there some additional cleanup function I should call to release all allocated memory? I am using version 2.40.13 on the Windows Linux subsystem, if that matters. The attached cheese.zip file contains the C++ file demonstrating both issues, a shell script that compiles and runs it, and the output I got.
You need to use "#" in front of the sub element name, i.e. "#cheese".
Ah! It would be nice if this was mentioned in the documentation. Looking around it seems as though valgrind gets some things wrong - what's the recommended way to run valgrind on an application using librsvg? Thanks, Oren.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/librsvg/issues/175.