• Ahmad Sherif's avatar
    Fix a memory leak caused by Banzai::Filter::SanitizationFilter · 504a3b5e
    Ahmad Sherif authored
    In Banzai::Filter::SanitizationFilter#customize_whitelist, we append
    three lambdas that has reference to the SanitizationFilter instance,
    which in turn (potentially) has a reference to the following chain:
    
    context hash -> Project instance -> Repository instance -> lookup hash
    -> various Rugged instances -> various mmap-ed git pack files.
    
    All of the above is not garbage collected because the array we append
    the lambdas to is the constant
    HTML::Pipeline::SanitizationFilter::WHITELIST.
    504a3b5e
sanitization_filter.rb 2.62 KB