<p></p>
<p dir="auto">In the following, the last <code>printf</code> to output before the segfault is <code>3 SCNotification</code>.  So apparently just testing <code>!editor->document->changed</code> is causing the segfault?</p>
<pre><code>bool NewPluginClass::editor_notify(GObject *object, GeanyEditor *editor, SCNotification *nt, NewPluginClass *self) {
  if (!self->enable) {
    return false;
  }

  printf("1 SCNotification = %lu\n", (ulong)nt);
  if (!editor) {
    printf("1a SCNotification = %lu\n", (ulong)nt);
    return false;
  }

  printf("2 SCNotification = %lu\n", (ulong)nt);
  if (editor && !editor->document) {
    printf("2a SCNotification = %lu\n", (ulong)nt);
    return false;
  }

  printf("3 SCNotification = %lu\n", (ulong)nt);
  if (editor && editor->document && !editor->document->changed) {
    printf("3a SCNotification = %lu\n", (ulong)nt);
    return false;
  }

  printf("4 SCNotification = %lu\n", (ulong)nt);
  if (editor && !editor->sci) {
    printf("4a SCNotification = %lu\n", (ulong)nt);
    return false;
  }

  printf("5 SCNotification = %lu\n", (ulong)nt);
  if (editor && editor->sci && sci_get_length(editor->sci) == 0) {
    printf("5a SCNotification = %lu\n", (ulong)nt);
    return false;
  }
  return false;
}
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/2998#issuecomment-967773694">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ32SN3SGNZVAZ2OIQDULXNVTANCNFSM5H6DYIIQ">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/AAIOWJZLS3OBWKPWJDQ7YIDULXNVTA5CNFSM5H6DYII2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHGXQ37Q.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/issues/2998#issuecomment-967773694",
"url": "https://github.com/geany/geany/issues/2998#issuecomment-967773694",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>