groue / GRMustache.swift

Flexible Mustache templates for Swift
http://mustache.github.com/
MIT License
594 stars 155 forks source link

Crashes in Xcode 10 #54

Closed shivayogic closed 5 years ago

shivayogic commented 5 years ago

Hi, I tried your changes in Xcode 9 it works fine. However it crashes for Xcode 10. Crash location is in MustacheBox.swift on line 470 i.e case .section: // {{# box }}...{{/ box }}

                // Push the value on the top of the context stack:
                let context = info.context.extendedContext(self)

This crashes for : temple = {{#children}}{{{.}}}{{/children}} values = ["children" : ["New string"]]

This works fine in case of values for dictionary is array of Int, double etc.

I am stuck. Please could you help me?

Kaliumhexacyanoferrat commented 5 years ago

Fixed this by preventing an object from being deallocated in Box.swift. Original:

let boxRendering = try Box(element).render(info)

Changed to:

let boxRef = Box(element)
let boxRendering = try boxRef.render(info)
shivayogic commented 5 years ago

Thank you. It works fine.