Comments (6)
One more memory leak when using class selector:
==89570== HEAP SUMMARY:
==89570== in use at exit: 70,276 bytes in 1,402 blocks
==89570== total heap usage: 98,778 allocs, 97,376 frees, 3,370,092 bytes allocated
==89570==
==89570== 40,960 bytes in 1,024 blocks are definitely lost in loss record 76 of 76
==89570== at 0x66BB: malloc (in /usr/local/Cellar/valgrind/3.10.1/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==89570== by 0x9A28D: operator new(unsigned long) (in /usr/lib/libc++.1.dylib)
==89570== by 0x100005727: CParser::parseTypeSelector() (in ./parser)
==89570== by 0x100004AB7: CParser::parseSimpleSelectorSequence() (in ./parser)
==89570== by 0x100003C8C: CParser::parseSelector() (in ./parser)
==89570== by 0x100003654: CParser::parseSelectorGroup() (in ./parser)
==89570== by 0x1000035D3: CParser::create(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) (in ./parser)
==89570== by 0x10001503E: CSelection::find(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) (in ./parser)
==89570== by 0x100002925: CDocument::find(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) (in ./parser)
==89570== by 0x1000022A3: test_parser() (in ./parser)
==89570== by 0x1000025B2: main (in ./parser)
from gumbo-query.
This one became visible after attempt to fix first memory leak like this:
from gumbo-query.
ecf701b - this fixes valgrind output for example code, but I'm not sure if it's ok in general
from gumbo-query.
The issue becomes apparent when you search the source code for "new" and then search the source code for delete. There's a single "delete" in the code, according to github search. If you look at the parsers and selectors, they all call new, alot. I see nowhere (at a quick glance) where anything is being deleted after.
from gumbo-query.
@TechnikEmpire there is an Object parent class that seems to be counting refrences.... somehow...
from gumbo-query.
Memory leak problem is solved
from gumbo-query.
Related Issues (20)
- CNode::startPos 与CNode::endPos颠倒的问题 HOT 3
- Crash when select string include '(' char. HOT 1
- Brew formula is wrong
- nth-of-type always select nothing
- add more examples
- Getting the OuterHTML HOT 2
- Getting nodes with a specific class HOT 5
- nth-child(odd) skips first node HOT 3
- CObject destructor can throw, but shouldn't
- Brew unable to install and unable to make HOT 1
- Unable to install Gumbo Query due to it unable to find Gumbo parser shared library HOT 2
- Problems while encoding russian symbols
- Document.h includes gumbo.h which is missing HOT 1
- Where is <gumbo.h> located at in the src folder? i have my own cmake workspace and just need the source code HOT 3
- Trimming strings for advanced datasets HOT 1
- Error: No available formula with the name "gumbo-query"
- Static library not found
- not support css3 selector
- Conan package
- crashed when syntax error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gumbo-query.