Compare commits
3 Commits
d5dde3658d
...
94ac44ddc5
Author | SHA1 | Date | |
---|---|---|---|
94ac44ddc5 | |||
1cbacef56c | |||
cae6a9c6c3 |
@ -39,9 +39,36 @@ static void layer_settings_init(LayerSettings *self)
|
||||
self->layer_infos = NULL;
|
||||
}
|
||||
|
||||
static void layer_info_delete_with_name(struct layer_info *const info)
|
||||
{
|
||||
if (!info)
|
||||
return;
|
||||
|
||||
if (info->name)
|
||||
free(info->name);
|
||||
free(info);
|
||||
}
|
||||
|
||||
static void layer_settings_dispose(GObject *obj)
|
||||
{
|
||||
LayerSettings *self;
|
||||
|
||||
self = GDS_RENDER_LAYER_SETTINGS(obj);
|
||||
|
||||
if (self->layer_infos) {
|
||||
g_list_free_full(self->layer_infos, (GDestroyNotify)layer_info_delete_with_name);
|
||||
self->layer_infos = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS(layer_settings_parent_class)->dispose(obj);
|
||||
}
|
||||
|
||||
static void layer_settings_class_init(LayerSettingsClass *klass)
|
||||
{
|
||||
(void)klass;
|
||||
GObjectClass *oclass;
|
||||
|
||||
oclass = G_OBJECT_CLASS(klass);
|
||||
oclass->dispose = layer_settings_dispose;
|
||||
|
||||
return;
|
||||
}
|
||||
@ -76,16 +103,6 @@ static struct layer_info *layer_info_copy(const struct layer_info * const info)
|
||||
return copy;
|
||||
}
|
||||
|
||||
static void layer_info_delete_with_name(struct layer_info *const info)
|
||||
{
|
||||
if (!info)
|
||||
return;
|
||||
|
||||
if (info->name)
|
||||
free(info->name);
|
||||
free(info);
|
||||
}
|
||||
|
||||
LayerSettings *layer_settings_new()
|
||||
{
|
||||
return g_object_new(GDS_RENDER_TYPE_LAYER_SETTINGS, NULL);
|
||||
|
@ -262,9 +262,10 @@ LayerSettings *gds_output_renderer_get_and_ref_layer_settings(GdsOutputRenderer
|
||||
/* Acquire settings lock */
|
||||
g_mutex_lock(&priv->settings_lock);
|
||||
|
||||
/* This function seems to already reference the LayerSettings object */
|
||||
g_object_get(renderer, "layer-settings", &ret, NULL);
|
||||
/* Reference it, so it is not cleared by another thread overwriting the property */
|
||||
g_object_ref(ret);
|
||||
//g_object_ref(ret);
|
||||
|
||||
/* It is now safe to clear the lock */
|
||||
g_mutex_unlock(&priv->settings_lock);
|
||||
@ -371,6 +372,8 @@ int gds_output_renderer_render_output_async(GdsOutputRenderer *renderer, struct
|
||||
}
|
||||
|
||||
priv->task = g_task_new(renderer, NULL, gds_output_renderer_async_finished, NULL);
|
||||
g_task_set_name(priv->task, "Rendering Thread");
|
||||
|
||||
g_mutex_lock(&priv->settings_lock);
|
||||
priv->async_params.cell = cell;
|
||||
priv->async_params.scale = scale;
|
||||
|
Loading…
Reference in New Issue
Block a user