Xming: Various tidy ups in winClipboardFlushXEvents()
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
This commit is contained in:
parent
fbe9ed27b1
commit
d190a27a33
|
@ -311,6 +311,7 @@ winClipboardFlushXEvents (HWND hwnd,
|
||||||
|
|
||||||
/* Initialize the text property */
|
/* Initialize the text property */
|
||||||
xtpText.value = NULL;
|
xtpText.value = NULL;
|
||||||
|
xtpText.nitems = 0;
|
||||||
|
|
||||||
/* Create the text property from the text list */
|
/* Create the text property from the text list */
|
||||||
if (fUseUnicode)
|
if (fUseUnicode)
|
||||||
|
@ -371,10 +372,13 @@ winClipboardFlushXEvents (HWND hwnd,
|
||||||
/* Release the clipboard data */
|
/* Release the clipboard data */
|
||||||
GlobalUnlock (hGlobal);
|
GlobalUnlock (hGlobal);
|
||||||
pszGlobalData = NULL;
|
pszGlobalData = NULL;
|
||||||
|
fCloseClipboard = FALSE;
|
||||||
|
CloseClipboard ();
|
||||||
|
|
||||||
/* Clean up */
|
/* Clean up */
|
||||||
XFree (xtpText.value);
|
XFree (xtpText.value);
|
||||||
xtpText.value = NULL;
|
xtpText.value = NULL;
|
||||||
|
xtpText.nitems = 0;
|
||||||
|
|
||||||
/* Setup selection notify event */
|
/* Setup selection notify event */
|
||||||
eventSelection.type = SelectionNotify;
|
eventSelection.type = SelectionNotify;
|
||||||
|
@ -405,7 +409,11 @@ winClipboardFlushXEvents (HWND hwnd,
|
||||||
winClipboardFlushXEvents_SelectionRequest_Done:
|
winClipboardFlushXEvents_SelectionRequest_Done:
|
||||||
/* Free allocated resources */
|
/* Free allocated resources */
|
||||||
if (xtpText.value)
|
if (xtpText.value)
|
||||||
|
{
|
||||||
XFree (xtpText.value);
|
XFree (xtpText.value);
|
||||||
|
xtpText.value = NULL;
|
||||||
|
xtpText.nitems = 0;
|
||||||
|
}
|
||||||
if (pszConvertData)
|
if (pszConvertData)
|
||||||
free (pszConvertData);
|
free (pszConvertData);
|
||||||
if (hGlobal && pszGlobalData)
|
if (hGlobal && pszGlobalData)
|
||||||
|
@ -446,7 +454,10 @@ winClipboardFlushXEvents (HWND hwnd,
|
||||||
|
|
||||||
/* Close clipboard if it was opened */
|
/* Close clipboard if it was opened */
|
||||||
if (fCloseClipboard)
|
if (fCloseClipboard)
|
||||||
|
{
|
||||||
|
fCloseClipboard = FALSE;
|
||||||
CloseClipboard ();
|
CloseClipboard ();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
@ -628,6 +639,7 @@ winClipboardFlushXEvents (HWND hwnd,
|
||||||
/* Conversion succeeded or some unconvertible characters */
|
/* Conversion succeeded or some unconvertible characters */
|
||||||
if (ppszTextList != NULL)
|
if (ppszTextList != NULL)
|
||||||
{
|
{
|
||||||
|
iReturnDataLen = 0;
|
||||||
for (i = 0; i < iCount; i++)
|
for (i = 0; i < iCount; i++)
|
||||||
{
|
{
|
||||||
iReturnDataLen += strlen(ppszTextList[i]);
|
iReturnDataLen += strlen(ppszTextList[i]);
|
||||||
|
@ -673,6 +685,7 @@ winClipboardFlushXEvents (HWND hwnd,
|
||||||
ppszTextList = NULL;
|
ppszTextList = NULL;
|
||||||
XFree (xtpText.value);
|
XFree (xtpText.value);
|
||||||
xtpText.value = NULL;
|
xtpText.value = NULL;
|
||||||
|
xtpText.nitems = 0;
|
||||||
|
|
||||||
/* Convert the X clipboard string to DOS format */
|
/* Convert the X clipboard string to DOS format */
|
||||||
winClipboardUNIXtoDOS (&pszReturnData, strlen (pszReturnData));
|
winClipboardUNIXtoDOS (&pszReturnData, strlen (pszReturnData));
|
||||||
|
@ -786,7 +799,11 @@ winClipboardFlushXEvents (HWND hwnd,
|
||||||
if (ppszTextList)
|
if (ppszTextList)
|
||||||
XFreeStringList (ppszTextList);
|
XFreeStringList (ppszTextList);
|
||||||
if (xtpText.value)
|
if (xtpText.value)
|
||||||
|
{
|
||||||
XFree (xtpText.value);
|
XFree (xtpText.value);
|
||||||
|
xtpText.value = NULL;
|
||||||
|
xtpText.nitems = 0;
|
||||||
|
}
|
||||||
if (pszConvertData)
|
if (pszConvertData)
|
||||||
free (pszConvertData);
|
free (pszConvertData);
|
||||||
if (pwszUnicodeStr)
|
if (pwszUnicodeStr)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user