astroidmail / astroid

A graphical threads-with-tags style, lightweight and fast, e-mail client for Notmuch
http://astroidmail.github.io
Other
606 stars 65 forks source link

compose_message: to load as byte array, 'file' must be wrapped with copy #733

Closed stephancb closed 1 year ago

stephancb commented 1 year ago

Attaching a file caused segfaults with some versions of glib. It turns out that when attaching a file, it is loaded as a byte array in compose_message.cc. For this a Gio smart pointer is obtained by wrapping the GFile pointer. The wrapping has to copy, i.e. wrap(,,, true), because the pointer will smartly cleanup when going out of scope, and then also the GFile pointer when getting unreferenced. This is my explanation for this pull request.

gauteh commented 1 year ago

Thanks!