I think there's a rule where to put the weakptrfactory (I guess is in the end of the member list, so it gets destroyed first), please double check this.