On Mon, 2009-04-27 at 14:52 -0700, Enlightenment SVN wrote:
> Log:
>   Use eina_stringshare_replace. Free the cursor after it is set.
>   
> Author:       devilhorns
> Date:         2009-04-27 14:52:44 -0700 (Mon, 27 Apr 2009)
> New Revision: 40423
> 
> Modified:
>   trunk/emprint/src/bin/main.c 
> 
> Modified: trunk/emprint/src/bin/main.c
> ===================================================================
> --- trunk/emprint/src/bin/main.c      2009-04-27 21:33:49 UTC (rev 40422)
> +++ trunk/emprint/src/bin/main.c      2009-04-27 21:52:44 UTC (rev 40423)
> @@ -301,8 +301,7 @@
>            strftime(buf, sizeof(buf), "%Y-%m-%d-%H%M%S.png", loctime);
>            /* set the new filename */
>            snprintf(buf, sizeof(buf), "%s/%s", opts->filename, strdup(buf));
> -          if (opts->filename) eina_stringshare_del(opts->filename);
> -          opts->filename = eina_stringshare_add(buf);
> +             eina_stringshare_replace(&opts->filename, buf);
>            return;
>         }
>       else 
> @@ -373,8 +372,7 @@
>         }
>       }
>     /* set the new filename */
> -   if (opts->filename) eina_stringshare_del(opts->filename);
> -   opts->filename = eina_stringshare_add(buf);
> +   eina_stringshare_replace(&opts->filename, buf);
>  }
>  
>  static void 
> @@ -464,8 +462,11 @@
>     ecore_x_keyboard_grab(input_window);
>  
>     /* set the mouse pointer */
> -   if ((cursor = ecore_x_cursor_shape_get(ECORE_X_CURSOR_CROSS)))
> -     ecore_x_window_cursor_set(input_window, cursor);
> +   if ((cursor = ecore_x_cursor_shape_get(ECORE_X_CURSOR_CROSS))) 
> +     {
> +        ecore_x_window_cursor_set(input_window, cursor);
> +        ecore_x_cursor_free(cursor);
> +     }
>  
The ecore_x_cursor docs state that you should not free the cursor that
you get with shape_get()

>     /* setup handler to recieve key event */
>     key_hdl = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, 
> @@ -517,8 +518,11 @@
>                                           _em_cb_mouse_down, NULL);
>  
>     /* set the mouse pointer */
> -   if ((cursor = ecore_x_cursor_shape_get(ECORE_X_CURSOR_CROSS)))
> -     ecore_x_window_cursor_set(input_window, cursor);
> +   if ((cursor = ecore_x_cursor_shape_get(ECORE_X_CURSOR_CROSS))) 
> +     {
> +        ecore_x_window_cursor_set(input_window, cursor);
> +        ecore_x_cursor_free(cursor);
> +     }
>  
>     /* create the rubber band */
>     _em_band_show();
> 
> 
> ------------------------------------------------------------------------------
> Register Now & Save for Velocity, the Web Performance & Operations 
> Conference from O'Reilly Media. Velocity features a full day of 
> expert-led, hands-on workshops and two days of sessions from industry 
> leaders in dedicated Performance & Operations tracks. Use code vel09scf 
> and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
> _______________________________________________
> enlightenment-svn mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn


------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to