Skip to content

Commit

Permalink
fix(Composer): memory leak
Browse files Browse the repository at this point in the history
when there's attachments uploaded, the dialog should be unowned
  • Loading branch information
GeopJr committed May 15, 2023
1 parent b7a6245 commit 028b743
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Dialogs/Composer/AttachmentsPage.vala
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public class Tuba.AttachmentsPage : ComposerPage {
Widget on_create_list_item (Object item) {
var attachment = item as API.Attachment;
var attachment_widget = new AttachmentsPageAttachment(attachment.id, attachment.source_file, dialog, attachment);

attachment_widget.remove_from_model.connect(() => {
uint indx;
var found = attachments.find (item, out indx);
Expand Down
2 changes: 1 addition & 1 deletion src/Dialogs/Composer/AttachmentsPageAttachment.vala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public class Tuba.AttachmentsPageAttachment : Widgets.Attachment.Item {
protected File? attachment_file;
protected string? alt_text { get; set; default = null; }
private const int ALT_MAX_CHARS = 1500;
private Dialogs.Compose compose_dialog;
private unowned Dialogs.Compose compose_dialog;
protected string id;

public AttachmentsPageAttachment (string attachment_id, File? file, Dialogs.Compose dialog, API.Attachment? t_entity){
Expand Down

0 comments on commit 028b743

Please sign in to comment.