summaryrefslogtreecommitdiff
path: root/src/PhotoPage.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-11-20 18:25:49 +0100
committerJörg Frings-Fürst <debian@jff.email>2023-11-20 18:25:49 +0100
commit394326a81d1248bbc5b1a35a8ae623c65ef6a9ea (patch)
tree315f7cf2a7934b0ecf45ac2caa3c87949a90dfc4 /src/PhotoPage.vala
parent918f560d56129ed03f19d843ea2efd7cb4b23821 (diff)
parent87ba373882f475f02a524a120b59ea9fcccf14e5 (diff)
Update upstream source from tag 'upstream/0.32.3'
Update to upstream version '0.32.3' with Debian dir e5e2a77e8650a79f6e85cccb15c070434b0fd667
Diffstat (limited to 'src/PhotoPage.vala')
-rw-r--r--src/PhotoPage.vala13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/PhotoPage.vala b/src/PhotoPage.vala
index 10ebb10..a279d89 100644
--- a/src/PhotoPage.vala
+++ b/src/PhotoPage.vala
@@ -78,17 +78,24 @@ public class ZoomBuffer : Object {
private TransformationJob? demand_transform_job = null; // only 1 demand transform job can be
// active at a time
private Workers workers = null;
- private SinglePhotoPage parent_page;
+ private unowned SinglePhotoPage parent_page;
private bool is_interactive_redraw_in_progress = false;
public ZoomBuffer(SinglePhotoPage parent_page, Photo backing_photo,
Gdk.Pixbuf preview_image) {
this.parent_page = parent_page;
+ this.parent_page.add_weak_pointer(&this.parent_page);
this.preview_image = preview_image;
this.backing_photo = backing_photo;
this.workers = new Workers(2, false);
}
+ ~ZoomBuffer() {
+ if (this.parent_page != null) {
+ this.parent_page.remove_weak_pointer(&this.parent_page);
+ }
+ }
+
private void on_iso_source_fetch_complete(BackgroundJob job) {
IsoSourceFetchJob fetch_job = (IsoSourceFetchJob) job;
if (fetch_job.fetched == null) {
@@ -103,7 +110,7 @@ public class ZoomBuffer : Object {
}
object_state = ObjectState.SOURCE_NOT_TRANSFORMED;
- if (!is_interactive_redraw_in_progress)
+ if (!is_interactive_redraw_in_progress && parent_page != null)
parent_page.repaint();
BackgroundJob transformation_job = new TransformationJob(this, iso_source_image,
@@ -140,7 +147,7 @@ public class ZoomBuffer : Object {
demand_transform_cached_pixbuf = transform_job.transformed;
demand_transform_job = null;
- parent_page.repaint();
+ if (parent_page != null) parent_page.repaint();
}
// passing a 'reduced_pixbuf' that has one-quarter the number of pixels as the 'iso_pixbuf' is