Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

memory leak in RenderingContext #192

Open
@catmando

Description

@catmando

RenderingContext.render builds a buffer of rendered elements. For example:

DIV do
  SPAN { 'span 1'}; SPAN { 'span 2' }; SPAN { 'span 3' }
end

rendering the DIV adds the three SPANs to the DIVs rendering buffer.
As each render completes the buffer is packed up as a the children of the element being rendered, and the newly rendered element is pushed onto the parents buffer...
So we have a stack of these buffers.

The problem is nobody ever clears the top most rendering buffer, so after each rendering cycle all of the top most renders children remain in the buffer, and the buffer just gets longer and longer.

There is a bunch of complications between how the buffer is managed to allow for nodes to be pulled from the buffer, etc, so the fix that I propose is kind of ugly:

Just use a class instance variable to detect if its an outer most render, and if it is, then reset the buffer in the ensure block.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions