Commit 919cfcb8 authored by Sébastien Wilmet's avatar Sébastien Wilmet

DocumentStructure: unowned -> weak ref to store the Document

To try to fix:
#57

But it doesn't fix the crash.
parent 56b59020
......@@ -33,7 +33,7 @@ public class DocumentStructure : GLib.Object
string? first_caption;
}
private unowned Document _doc;
private weak Document? _doc = null;
private int _nb_marks = 0;
private const string MARK_NAME_PREFIX = "struct_item_";
private TextMark? _end_document_mark = null;
......@@ -134,6 +134,9 @@ public class DocumentStructure : GLib.Object
// Parse the document. Returns false if finished, true otherwise.
private bool parse_impl ()
{
if (_doc == null)
return false;
if (_measure_parsing_time)
{
if (_timer == null)
......@@ -717,6 +720,9 @@ public class DocumentStructure : GLib.Object
{
refresh_simple_list = false;
if (_doc == null)
return;
/* Comment */
if (action_type == StructAction.COMMENT)
......
Markdown is supported
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