Fixed ag_window_set_chart() so it connects the signal handlers well

This commit is contained in:
Gergely Polonkai 2013-09-17 22:20:07 +02:00
parent a023606320
commit 60d57c7333

View File

@ -336,8 +336,13 @@ ag_window_new(AgApp *app)
void void
ag_window_set_chart(AgWindow *window, AgChart *chart) ag_window_set_chart(AgWindow *window, AgChart *chart)
{ {
if (window->priv->chart != NULL) {
g_signal_handlers_disconnect_by_func(window->priv->chart, chart_changed, window);
g_object_unref(window->priv->chart); g_object_unref(window->priv->chart);
}
window->priv->chart = chart; window->priv->chart = chart;
g_signal_connect(window->priv->chart, "changed", G_CALLBACK(chart_changed), window);
g_object_ref(chart); g_object_ref(chart);
} }