mirror of https://github.com/jetkvm/kvm.git
fix: clean-up cancel function
This commit is contained in:
parent
d6d113e253
commit
1097deeaf8
|
|
@ -141,6 +141,7 @@ func (ps *PublicIPState) Start() {
|
||||||
if ps.timer != nil {
|
if ps.timer != nil {
|
||||||
ps.timer.Stop()
|
ps.timer.Stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
if ps.cancel != nil {
|
if ps.cancel != nil {
|
||||||
ps.cancel()
|
ps.cancel()
|
||||||
}
|
}
|
||||||
|
|
@ -159,7 +160,9 @@ func (ps *PublicIPState) Stop() {
|
||||||
|
|
||||||
if ps.cancel != nil {
|
if ps.cancel != nil {
|
||||||
ps.cancel()
|
ps.cancel()
|
||||||
|
ps.cancel = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if ps.timer != nil {
|
if ps.timer != nil {
|
||||||
ps.timer.Stop()
|
ps.timer.Stop()
|
||||||
ps.timer = nil
|
ps.timer = nil
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue