Writing map<enum class, custom Root class> to tree

WeightMap *wmap = 0; // 0 ... or ... new WeightMap

after using WeightMap * wmap = 0; the crashes disappear.