123456
if (dispatch != 0) { uint32_t ref_count; while ((ref_count = dispatch->Release()) > 0) { } assert(ref_count == 0); dispatch = 0; }