Opened 8 years ago
Last modified 5 years ago
#10954 new Bugs
boost::spirit::iterator_policies::split_std_deque memory leak on reference count
| Reported by: | Owned by: | Joel de Guzman | |
|---|---|---|---|
| Milestone: | To Be Determined | Component: | spirit | 
| Version: | Boost 1.57.0 | Severity: | Problem | 
| Keywords: | iterator memory leak spirit multi_pass | Cc: | 
Description
The split_std_deque implementation does not free unsued memory if only one reference to it remains. This is even true when invoking clear_queue(). See attaches example for more details.
Attachments (1)
Change History (2)
by , 8 years ago
| Attachment: | split_std_deque.cpp added | 
|---|
comment:1 by , 5 years ago
I can confirm the problem.
Once the iterator count goes down to one, and the queue is no longer needed, it is cleared, freeing up memory - actually both of statements found in documentation are violated:
- The queue is not cleared in this case (but manual 
clear_queue()works) - Because 
split_std_dequeis actually implemented on top ofstd::vectorit does not return memory to system upon callingclear()(theshrink_to_fit()call appeared only on C++11) 
  Note:
 See   TracTickets
 for help on using tickets.
    
example causing the memory leak