Skip to content

Commit

Permalink
Do not raise GICrystal::ObjectCollectedError on unsafe versions of vf…
Browse files Browse the repository at this point in the history
…unc.

Soon I'll land fixes for Gtk::Expression in gtk4 shards that will depend on
this because Gtk::Expression may try to fetch object properties too early
before the Crystal instance gets instantiated.
  • Loading branch information
hugopl committed Aug 24, 2024
1 parent ef0f255 commit 259e050
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ecr/v_func.ecr
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
private def self._vfunc_unsafe_<%= vfunc.name %>(%this : Pointer(Void), <% generate_lib_args(io, vfunc) %>) : <%= return_type %>
<%-= vfunc_gi_annotations %>
%instance = LibGObject.g_object_get_qdata(%this, GICrystal::INSTANCE_QDATA_KEY)
raise GICrystal::ObjectCollectedError.new if %instance.null?
return <%= type_info_default_value(vfunc.return_type) %> if %instance.null?

%instance.as(self).{{ impl_method_name.id }}(<% call_user_method_with_lib_args(io) %>)
end
Expand Down

0 comments on commit 259e050

Please sign in to comment.