@iglesias Thanks for code reviewing! You know much better the REF/UNREF :) 
If we do SG_REF(m_factor_type) here, the place where it has been called would have to do an UNREF?
And how about CDynamicObjectArray* CFactorGraph::get_factors()? Does REF needed here?