browser icon indicating copy to clipboard operation
browser copied to clipboard

libdom: unref nodes and strings

Open krichprollsch opened this issue 1 year ago • 0 comments

netsurf/libdom uses a ref counter to track node and string usage an cleanup memory once the ref count reach 0.

see:

  • https://github.com/Browsercore/libdom/blob/master/include/dom/core/string.h#L35-L41
  • https://github.com/Browsercore/libdom/blob/master/include/dom/core/node.h#L195-L202

We have to ensure our usages of strings and nodes unref correctly once they are done.

To help detect string leak, we can USS a leak detector the same way netsurf does in its example: https://github.com/Browsercore/libdom/blob/master/examples/dom-structure-dump.c#L372

krichprollsch avatar Nov 22 '23 10:11 krichprollsch