please use SG_UNREF whenever possible instead of delete