Move chttp2 cleanup code into close_transport_locked().
diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
index 607fbf3..3a2c4b6 100644
--- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
+++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
@@ -651,6 +651,11 @@
     GPR_ASSERT(t->write_state == GRPC_CHTTP2_WRITE_STATE_IDLE);
     grpc_endpoint_shutdown(exec_ctx, t->ep, GRPC_ERROR_REF(error));
   }
+  if (t->notify_on_receive_settings != nullptr) {
+    GRPC_CLOSURE_SCHED(exec_ctx, t->notify_on_receive_settings,
+                       GRPC_ERROR_CANCELLED);
+    t->notify_on_receive_settings = nullptr;
+  }
   GRPC_ERROR_UNREF(error);
 }
 
@@ -1823,11 +1828,6 @@
 
   if (op->disconnect_with_error != GRPC_ERROR_NONE) {
     close_transport_locked(exec_ctx, t, op->disconnect_with_error);
-    if (t->notify_on_receive_settings != nullptr) {
-      GRPC_CLOSURE_SCHED(exec_ctx, t->notify_on_receive_settings,
-                         GRPC_ERROR_CANCELLED);
-      t->notify_on_receive_settings = nullptr;
-    }
   }
 
   GRPC_CLOSURE_RUN(exec_ctx, op->on_consumed, GRPC_ERROR_NONE);