*doh* I can't believe I didn't update those references... Thanks for
pointing it out.

Jason

---
Day xee-nee-svsh duu-'ushtlh-ts'it;
nuu-wee-ya' duu-xan' 'vm-nvshtlh-ts'it.
Huu-chan xuu naa~-gha.



On Sun, Aug 21, 2011 at 11:15 PM, Peter Hutterer
<peter.hutte...@who-t.net> wrote:
> On Fri, Aug 19, 2011 at 05:23:52PM -0700, Jason Gerecke wrote:
>> We now call XRRFreeScreenResources as soon as practical to allow the
>> now-following logic to return at its leisure. Additionally, we also
>> copy the data from 'crtc_info' locally and free it ASAP.
>> ---
>> Changes from v1:
>>  * Free crtc_info
>>
>>  tools/xsetwacom.c |   13 +++++++++----
>>  1 files changed, 9 insertions(+), 4 deletions(-)
>>
>> diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c
>> index 9d47ea6..dd0a3e5 100644
>> --- a/tools/xsetwacom.c
>> +++ b/tools/xsetwacom.c
>> @@ -2006,6 +2006,7 @@ static void _set_matrix(Display *dpy, XDevice *dev,
>>  static void set_output_xrandr(Display *dpy, XDevice *dev, param_t *param, 
>> int argc, char **argv)
>>  {
>>       int i, found = 0;
>> +     int x, y, width, height;
>>       char *output_name;
>>       XRRScreenResources *res;
>>       XRROutputInfo *output_info;
>> @@ -2014,7 +2015,6 @@ static void set_output_xrandr(Display *dpy, XDevice 
>> *dev, param_t *param, int ar
>>       output_name = argv[0];
>>
>>       res = XRRGetScreenResources(dpy, DefaultRootWindow(dpy));
>> -
>>       for (i = 0; i < res->noutput && !found; i++)
>>       {
>>               output_info = XRRGetOutputInfo(dpy, res, res->outputs[i]);
>> @@ -2026,8 +2026,13 @@ static void set_output_xrandr(Display *dpy, XDevice 
>> *dev, param_t *param, int ar
>>                       continue;
>>
>>               crtc_info = XRRGetCrtcInfo (dpy, res, output_info->crtc);
>> -             TRACE("CRTC (%dx%d) %dx%d\n", crtc_info->x, crtc_info->y,
>> -                     crtc_info->width, crtc_info->height);
>> +             x = crtc_info->x;
>> +             y = crtc_info->y;
>> +             width = crtc_info->width;
>> +             height = crtc_info->height;
>> +             XRRFreeCrtcInfo(crtc_info);
>> +
>> +             TRACE("CRTC (%dx%d) %dx%d\n", x, y, width, height);
>>
>>               if (strcmp(output_info->name, output_name) == 0)
>>               {
>> @@ -2035,6 +2040,7 @@ static void set_output_xrandr(Display *dpy, XDevice 
>> *dev, param_t *param, int ar
>>                       break;
>>               }
>>       }
>> +     XRRFreeScreenResources(res);
>>
>
> not visible in this patch context but we access crtc_info just after here,
> but we already free'd it in the previous hunk.
>
> Cheers,
>  Peter
>
>>       /* crtc holds our screen info, need to compare to actual screen size */
>>       if (found)
>> @@ -2046,7 +2052,6 @@ static void set_output_xrandr(Display *dpy, XDevice 
>> *dev, param_t *param, int ar
>>               printf("Unable to find output '%s'. "
>>                       "Output may not be connected.\n", output_name);
>>
>> -     XRRFreeScreenResources(res);
>>  }
>>
>>  /**
>> --
>> 1.7.6
>

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to