I think you can remove this and the change in SetImage from reference to pointer. Since with the weakptr, you now will not execute this in a "wrong scenario" anymore.