A question about imshow

I’m using imshow to display the debug image, but it will get stuck in one place. I don’t know how to solve it.

cv::imshow("view", img);

Stuck code file:

opencv-4.6.0\modules\highgui\src\window_w32.cpp

Line 1364

MoveWindow(window.hwnd, rect.left, rect.top,
               rect.right - rect.left,
               rect.bottom - rect.top, TRUE);

you are failing to call waitKey()

No, I called it at first, but actually I didn’t execute that line of statements.
Every time I pause the program, he will stop at that position.