summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/windows
diff options
context:
space:
mode:
author Oliver Stöneberg <firewave@users.noreply.github.com>2012-07-27 15:24:08 +0000
committer Oliver Stöneberg <firewave@users.noreply.github.com>2012-07-27 15:24:08 +0000
commit5864158d33b36781075e4e1aef7c96b97c387ac1 (patch)
tree0e144d334e6b950c8e3e1cc3a2c82bdf331b1cc2 /src/osd/windows
parentb208149acc16f41c980ff47ec6503b3977b94fe3 (diff)
allow "windowname" in win_create_window_ex_utf8() to be NULL to match behavior of CreateWindowEx() (no whatsnew)
Diffstat (limited to 'src/osd/windows')
-rw-r--r--src/osd/windows/winutf8.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/osd/windows/winutf8.c b/src/osd/windows/winutf8.c
index 4fc877fdc3a..4e7ca623d74 100644
--- a/src/osd/windows/winutf8.c
+++ b/src/osd/windows/winutf8.c
@@ -268,24 +268,27 @@ HWND win_create_window_ex_utf8(DWORD exstyle, const char* classname, const char*
int x, int y, int width, int height, HWND parent, HMENU menu,
HINSTANCE instance, void* param)
{
- TCHAR* t_classname;
- TCHAR* t_windowname;
+ TCHAR* t_classname = NULL;
+ TCHAR* t_windowname = NULL;
HWND result = 0;
t_classname = tstring_from_utf8(classname);
if( !t_classname )
return result;
- t_windowname = tstring_from_utf8(windowname);
- if( !t_windowname ) {
- osd_free(t_classname);
- return result;
+ if( windowname ) {
+ t_windowname = tstring_from_utf8(windowname);
+ if( !t_windowname ) {
+ osd_free(t_classname);
+ return result;
+ }
}
result = CreateWindowEx(exstyle, t_classname, t_windowname, style, x, y, width, height, parent,
menu, instance, param);
- osd_free(t_windowname);
+ if( t_windowname )
+ osd_free(t_windowname);
osd_free(t_classname);
return result;