printoperation: fix case where operation may complete multiple twice
authorMichael Catanzaro <mcatanzaro@redhat.com>
Tue, 26 Sep 2023 23:47:01 +0000 (18:47 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 28 Sep 2023 00:42:45 +0000 (20:42 -0400)
commit29a243e3d78f13e94e25517bf95323c3537a118c
tree902db52ce60df9f6de7c2e653b2baed2f15f00d8
parentd4d0883a924f94fdc89fad50bce9ecad3128e0f3
printoperation: fix case where operation may complete multiple twice

If we are the final backend, then after removing ourselves there is no
backend remaining. We will schedule the idle even if it has already been
scheduled. This idle is required to run exactly once and executing it
twices results in a double free that crashes loupe when printing. It
also causes the user callback to execute twice, which could cause
similar problems.

Fixes #6122
gtk/print/gtkprintoperation-unix.c