e_eom: set NULL to the eom_output->eom_client 84/211984/2
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 13 Aug 2019 05:59:27 +0000 (14:59 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Wed, 14 Aug 2019 02:32:27 +0000 (02:32 +0000)
set NULL when the destroying client is assigned at the eom_output

Change-Id: If255d2ae89dbde47641e20c467454729283181f8

src/bin/e_eom.c

index 9d4acaa6fcb0ae96ea2e362d133c656606003a87..63f922e0e4d53e19ecfe40809e7fbdc596cbf553 100644 (file)
@@ -296,6 +296,7 @@ _e_eom_output_create(E_Output *output, Eina_Bool added)
    eom_output->output = output;
    eom_output->type = (eom_output_type_e)output->toutput_type;
    eom_output->added = added;
+   eom_output->eom_client = NULL;
 
    g_eom->eom_outputs = eina_list_append(g_eom->eom_outputs, eom_output);
 
@@ -754,11 +755,12 @@ _e_eom_cb_wl_eom_client_destroy(struct wl_resource *resource)
    eom_client = _e_eom_client_get_by_resource(resource);
    EINA_SAFETY_ON_NULL_RETURN(eom_client);
 
-   g_eom->clients = eina_list_remove(g_eom->clients, eom_client);
-
    eom_output = _e_eom_output_get_by_id(eom_client->output_id);
    EINA_SAFETY_ON_NULL_GOTO(eom_output, end);
 
+   if (eom_client == eom_output->eom_client)
+     eom_output->eom_client = NULL;
+
    output_ec = e_output_presentation_ec_get(eom_output->output);
    if (eom_client->ec == output_ec)
      {
@@ -776,6 +778,8 @@ end:
    if (eom_output)
      _e_eom_output_status_broadcast(eom_output, eom_client, EOM_OUTPUT_ATTRIBUTE_STATE_NONE);
 
+   g_eom->clients = eina_list_remove(g_eom->clients, eom_client);
+
    free(eom_client);
 }