@@ -1166,6 +1166,7 @@ G_BEGIN_DECLS
11661166struct GAFlightServerPrivate
11671167{
11681168 gaflight::Server server;
1169+ GAFlightServerOptions *options;
11691170};
11701171
11711172G_END_DECLS
@@ -1196,6 +1197,19 @@ gaflight_server_servable_get_raw(GAFlightServable *servable)
11961197}
11971198G_BEGIN_DECLS
11981199
1200+ static void
1201+ gaflight_server_dispose (GObject *object)
1202+ {
1203+ auto priv = GAFLIGHT_SERVER_GET_PRIVATE (object);
1204+
1205+ if (priv->options ) {
1206+ g_object_unref (priv->options );
1207+ priv->options = nullptr ;
1208+ }
1209+
1210+ G_OBJECT_CLASS (gaflight_server_parent_class)->dispose (object);
1211+ }
1212+
11991213static void
12001214gaflight_server_finalize (GObject *object)
12011215{
@@ -1216,6 +1230,7 @@ static void
12161230gaflight_server_class_init (GAFlightServerClass *klass)
12171231{
12181232 auto gobject_class = G_OBJECT_CLASS (klass);
1233+ gobject_class->dispose = gaflight_server_dispose;
12191234 gobject_class->finalize = gaflight_server_finalize;
12201235}
12211236
@@ -1236,6 +1251,14 @@ gaflight_server_listen(GAFlightServer *server,
12361251{
12371252 auto flight_server = gaflight_servable_get_raw (GAFLIGHT_SERVABLE (server));
12381253 const auto flight_options = gaflight_server_options_get_raw (options);
1254+ auto priv = GAFLIGHT_SERVER_GET_PRIVATE (server);
1255+ if (priv->options != options) {
1256+ g_object_ref (options);
1257+ if (priv->options ) {
1258+ g_object_unref (priv->options );
1259+ }
1260+ priv->options = options;
1261+ }
12391262 return garrow::check (error,
12401263 flight_server->Init (*flight_options),
12411264 " [flight-server][listen]" );
0 commit comments