summaryrefslogtreecommitdiffstats
path: root/hugolib
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2015-11-21 20:03:18 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2015-11-21 20:03:18 +0100
commit58c446f56282cb8c24f5dce0ef03e5e7bebe00ef (patch)
tree035e26655d1e63105154917da61c99fb49cd1634 /hugolib
parent5c7234015d15ca860f3c40dac112d1c3b38346f4 (diff)
Fix recently introduced new data race in the shortcode handling
Fixes #1599
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/shortcode.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/hugolib/shortcode.go b/hugolib/shortcode.go
index e65a85989..c49418b85 100644
--- a/hugolib/shortcode.go
+++ b/hugolib/shortcode.go
@@ -343,9 +343,14 @@ Loop:
if tmpl == nil {
return sc, fmt.Errorf("Unable to locate template for shortcode '%s' in page %s", sc.name, p.BaseFileName())
}
+
+ // TODO(bep) Refactor/rename this lock strategy
+ isInnerShortcodeCache.Lock()
if tmpl.Tree == nil {
+ isInnerShortcodeCache.Unlock()
return sc, fmt.Errorf("Template for shortcode '%s' failed to compile for page '%s'", sc.name, p.BaseFileName())
}
+ isInnerShortcodeCache.Unlock()
isInner = isInnerShortcode(tmpl)
case tScParam: