bugfix [#23725] bpy.context.window_manager.

This commit is contained in:
Campbell Barton 2010-09-08 21:47:16 +00:00
parent cc0d31b921
commit 2d4e8ba22f
1 changed files with 17 additions and 7 deletions

View File

@ -617,19 +617,29 @@ static void rna_wmClipboard_get(PointerRNA *ptr, char *value)
char *pbuf;
pbuf= WM_clipboard_text_get(FALSE);
strcpy(value, pbuf);
MEM_freeN(pbuf);
if(pbuf) {
strcpy(value, pbuf);
MEM_freeN(pbuf);
}
else {
value[0]= '\0';
}
}
static int rna_wmClipboard_length(PointerRNA *ptr)
{
char *clipboard;
char *pbuf;
int length;
clipboard = WM_clipboard_text_get(FALSE);
length = (clipboard?strlen(clipboard):0);
MEM_freeN(clipboard);
pbuf = WM_clipboard_text_get(FALSE);
if(pbuf) {
length = strlen(pbuf);
MEM_freeN(pbuf);
}
else {
length= 0;
}
return length;
}