Skip to content
  • Aaron Patterson's avatar
    52eafbd7
    Add a finalizer to inline templates · 52eafbd7
    Aaron Patterson authored
    This commit adds a finalizer just to inline templates.  We can't cache
    compilation of inline templates because it's possible that people could
    have render calls that look like this:
    
    ```ruby
    loop do
      render inline: "#{rand}"
    end
    ```
    
    and we would cache every one of these different inline templates.  That
    would cause a memory leak.  OTOH, we don't need finalizers on regular
    templates because we can cache, control, and detect changes to the
    template source.
    
    Fixes: #35372
    52eafbd7
    Add a finalizer to inline templates
    Aaron Patterson authored
    This commit adds a finalizer just to inline templates.  We can't cache
    compilation of inline templates because it's possible that people could
    have render calls that look like this:
    
    ```ruby
    loop do
      render inline: "#{rand}"
    end
    ```
    
    and we would cache every one of these different inline templates.  That
    would cause a memory leak.  OTOH, we don't need finalizers on regular
    templates because we can cache, control, and detect changes to the
    template source.
    
    Fixes: #35372
Loading