[
https://issues.apache.org/jira/browse/THRIFT-3706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15877096#comment-15877096
]
ASF GitHub Bot commented on THRIFT-3706:
----------------------------------------
Github user jeking3 commented on a diff in the pull request:
https://github.com/apache/thrift/pull/1200#discussion_r102356814
--- Diff: lib/c_glib/src/thrift/c_glib/protocol/thrift_protocol.c ---
@@ -61,15 +61,15 @@ thrift_protocol_set_property (GObject *object, guint
property_id,
switch (property_id)
{
case PROP_THRIFT_PROTOCOL_TRANSPORT:
- protocol->transport = g_value_get_object (value);
--- End diff --
"should" live as long. Why should we impose a requirement that the
consuming application, using an object oriented-ish language like glib, be
required to ensure the underlying transport outlives the protocol that is
consuming it?
The copy should not lead to memory issues because the dispose method in
this class unreferences and clears the pointer. This means the consuming
application does a g_object_new, that's one reference. The protocol consumes
it, that's a second reference. If the consuming application were to unref the
transport, it would crash. But by using reference counts on objects the way
they were intended to be used, a consuming application could quite literally
unref everything but the server before serve() and then unref the server when
it returns, and there would be no leaks or problems. I don't think it's a good
practice to force the consuming application to guarantee the lifetime of
pointers that reference each-other when the object library itself provides
reference counting and garbage collection. That's why I changed it here and in
other classes like ThriftServer.
> There's no support for Multiplexed protocol on c_glib library
> -------------------------------------------------------------
>
> Key: THRIFT-3706
> URL: https://issues.apache.org/jira/browse/THRIFT-3706
> Project: Thrift
> Issue Type: Improvement
> Components: C glib - Library
> Affects Versions: 0.9.3
> Reporter: Gonzalo Aguilar
> Assignee: James E. King, III
> Fix For: 0.11.0
>
>
> There's no multiplexed protocol.
> I will implement the same way it's done in Java an C++
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)