Bug Description

Going through the Checkbox Unity Tests for Unity 5.4, got to test #120 and tried on gedit. When right-clicking on the gedit title bar and selecting close, the first time nothing happens, when doing it a second time, gedit crashes.

I added the gedit-valencia-plugin package as the retrace shows it crashed in libvalencia. In addition, the fact that it crashed in instance_active_document_is_vala_file() may be a hint: as far as I remember I did not have any document open when the crash occured.