Commit 1daf96cb authored by swilmet's avatar swilmet
Browse files

Document: weak ref on the DocumentTab

If latexila opens just one DocumentTab, on application exit there were 3
remaining refs to that DocumentTab. Now it's reduced to 2 remaining
refs. So the memory leak is not fixed, but it's one step closer to fix

Note that an object should not be aware of who contains it. It's fine
for DocumentTab to know about Document, since Document is contained in
DocumentTab, but the reverse is not a good practice. This code was
written a long time ago…
parent 6bfc7eec
......@@ -23,7 +23,7 @@ public class Document : Gtef.Buffer
public File location { get; set; }
public bool readonly { get; set; default = false; }
public DocumentTab tab;
public weak DocumentTab tab;
public uint _unsaved_doc_num = 0;
public int project_id { get; set; default = -1; }
private bool backup_made = false;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment