network: Fix a possible memory leak in QR code

It's possible that the QR code for the same text has been requested,
but for a different size.  Fix a memory leak that would happen
in those cases.
This commit is contained in:
Mohammed Sadiq 2022-02-11 11:25:59 +05:30 committed by Georges Basile Stavracas Neto
parent 7c9c42fb65
commit 0452e9eb4d

View file

@ -175,6 +175,7 @@ cc_qr_code_get_paintable (CcQrCode *self,
bytes = g_byte_array_free_to_bytes (qr_matrix);
g_clear_object (&self->texture);
self->texture = gdk_memory_texture_new (total_size,
total_size,
GDK_MEMORY_R8G8B8,