lib/mize/reload.rb in mize-0.3.1 vs lib/mize/reload.rb in mize-0.3.2

- old
+ new

@@ -1,12 +1,15 @@ module Mize::Reload # Reload this object if a #reload method was provided up somewhere in the # inheritance tree, afterwards clear the memoization cache and return self. def reload(*) - result = self - if defined? super - result = super + Mize::MUTEX.synchronize do + result = self + if defined? super + result = super + end + Mize.wrapped.clear + mize_cache_clear + result end - mize_cache_clear - result end end