+static void pty_chr_timer_cancel(PtyChardev *s)
+{
+ if (s->timer_src) {
+ g_source_destroy(s->timer_src);
+ g_source_unref(s->timer_src);
+ s->timer_src = NULL;
+ }
+}
+
+static void pty_chr_open_src_cancel(PtyChardev *s)
+{
+ if (s->open_source) {
+ g_source_destroy(s->open_source);
+ g_source_unref(s->open_source);
+ s->open_source = NULL;
+ }
+}
+