Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About the timer release collapse #31

Open
MoShenGuo opened this issue Jul 20, 2018 · 4 comments
Open

About the timer release collapse #31

MoShenGuo opened this issue Jul 20, 2018 · 4 comments

Comments

@MoShenGuo
Copy link

MoShenGuo commented Jul 20, 2018

/// Destroy current timer
private func destroyTimer() {
self.timer?.setEventHandler(handler: nil)
self.timer?.cancel()

	if state == .paused || state == .finished {
		self.timer?.resume()
	}
}

This method when the order is written is wrong, the timer if is put up, is to call self. The timer?resume (), and then call the self. The timer?.cancel () in the self. The timer = nil to release,Or it will collapse

@MoShenGuo MoShenGuo changed the title 关于定时器释放崩溃原因 About the timer release collapse Jul 20, 2018
@Samback
Copy link

Samback commented Aug 31, 2018

Faced with crash that related to this part of code.

#5. Crashed: com.repeat.queue
0  libdispatch.dylib              0x180859630 _dispatch_queue_xref_dispose$VARIANT$mp + 72
1  libdispatch.dylib              0x180854e18 -[OS_dispatch_source _xref_dispose] + 24
2  Repeat                         0x102343944 _T06Repeat8RepeaterC8setPause33_97E5396AC7E12D74879B993A593805A9LLSbAC5StateO4from_AG2totF + 240
3  Repeat                         0x102343c74 _T06Repeat8RepeaterC9timeFired33_97E5396AC7E12D74879B993A593805A9LLyyF + 752
4  Repeat                         0x102342b48 _T06Repeat8RepeaterC14configureTimer33_97E5396AC7E12D74879B993A593805A9LLSo014DispatchSourceD0_pyFyycfU_ + 124
5  Repeat                         0x102342b94 _T0Ieg_IeyB_TR + 52
6  libdispatch.dylib              0x180854a60 _dispatch_client_callout + 16
7  libdispatch.dylib              0x18085ce94 _dispatch_continuation_pop$VARIANT$mp + 424
8  libdispatch.dylib              0x180866784 _dispatch_source_invoke$VARIANT$mp + 1364
9  libdispatch.dylib              0x18085e86c _dispatch_queue_serial_drain$VARIANT$mp + 280
10 libdispatch.dylib              0x18085f2fc _dispatch_queue_invoke$VARIANT$mp + 336
11 libdispatch.dylib              0x18085fcc8 _dispatch_root_queue_drain_deferred_wlh$VARIANT$mp + 340
12 libdispatch.dylib              0x180868098 _dispatch_workloop_worker_thread$VARIANT$mp + 668
13 libsystem_pthread.dylib        0x180b87e70 _pthread_wqthread + 860
14 libsystem_pthread.dylib        0x180b87b08 start_wqthread + 4

@ghost
Copy link

ghost commented Dec 4, 2018

I have also similar issue.

@aligermiyanoglu
Copy link

I have also similar issue.

+1

@Samback
Copy link

Samback commented Dec 26, 2019

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants