mirror of
https://github.com/containers/podman.git
synced 2025-07-31 04:12:40 +08:00
Stop timer in function waitPidStop
Because it will cause memory leak if we do not stop timer when the function has completed. [NO NEW TESTS NEEDED] Signed-off-by: hang.jiang <hang.jiang@daocloud.io>
This commit is contained in:
@ -1000,6 +1000,7 @@ func waitContainerStop(ctr *Container, timeout time.Duration) error {
|
|||||||
// Wait for a given PID to stop
|
// Wait for a given PID to stop
|
||||||
func waitPidStop(pid int, timeout time.Duration) error {
|
func waitPidStop(pid int, timeout time.Duration) error {
|
||||||
timer := time.NewTimer(timeout)
|
timer := time.NewTimer(timeout)
|
||||||
|
defer timer.Stop()
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-timer.C:
|
case <-timer.C:
|
||||||
|
Reference in New Issue
Block a user