Re: Patch: Win32 crash fix


Subject: Re: Patch: Win32 crash fix
From: Andrew Dunbar (hippietrail@yahoo.com)
Date: Fri May 18 2001 - 06:26:07 CDT


Mike Nordell wrote:
>
> Andrew Dunbar wrote:
>
> > case EV_EEMR_COMPLETE:
> > - UT_ASSERT(pEM);
> > - invokeKeyboardMethod(pView,pEM,&charData,1);
> > + {
> > + UT_ASSERT(pEM);
> > + UT_UCSChar *ucs = new UT_UCSChar[1];
> > + ucs[0] = charData;
> > + invokeKeyboardMethod(pView,pEM,ucs,1);
> > + delete [] ucs;
> > + }
>
> Why not simply:
>
> UT_UCSChar ucs = charData;
> invokeKeyboardMethod(pView,pEM,&ucs,1);
>
> or if charData already is UT_UCSChar, why not use it directly? Why new'ing
> an *array* of one single UT_UCSChar???

Shoulda looked closer before I sent that. Reason was that it
looked like the code that used it was deleting it and it looked like
the Unix code did something similar. And it's been sitting around
for a week now.

But that makes me wonder why it was crashing with the old code...

Andrew Dunbar.

-- 
http://linguaphile.sourceforge.net

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




This archive was generated by hypermail 2b25 : Sat May 26 2001 - 03:51:04 CDT