[ 1587248 ] Segfault w/o Session Manager (e.g. KDE/GNOME ...)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42723 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -293,27 +293,32 @@ wxPortId wxGUIAppTraits::GetToolkitVersion(int *verMaj, int *verMin) const
|
|||||||
#if wxUSE_DETECT_SM
|
#if wxUSE_DETECT_SM
|
||||||
static wxString GetSM()
|
static wxString GetSM()
|
||||||
{
|
{
|
||||||
Display *dpy;
|
Display *dpy;
|
||||||
SmcConn smc_conn;
|
SmcConn smc_conn;
|
||||||
char *vendor;
|
char *vendor;
|
||||||
char *client_id_ret;
|
char *client_id_ret;
|
||||||
dpy = XOpenDisplay(NULL);
|
dpy = XOpenDisplay(NULL);
|
||||||
|
|
||||||
smc_conn = SmcOpenConnection(NULL, NULL,
|
smc_conn = SmcOpenConnection(NULL, NULL,
|
||||||
999, 999,
|
999, 999,
|
||||||
0 /* mask */, NULL /* callbacks */,
|
0 /* mask */, NULL /* callbacks */,
|
||||||
NULL, &client_id_ret, 0, NULL);
|
NULL, &client_id_ret, 0, NULL);
|
||||||
|
|
||||||
vendor = SmcVendor(smc_conn);
|
if (smc_conn)
|
||||||
wxString ret = wxString::FromAscii( vendor );
|
{
|
||||||
free(vendor);
|
vendor = SmcVendor(smc_conn);
|
||||||
|
wxString ret = wxString::FromAscii( vendor );
|
||||||
|
free(vendor);
|
||||||
|
|
||||||
SmcCloseConnection(smc_conn, 0, NULL);
|
SmcCloseConnection(smc_conn, 0, NULL);
|
||||||
free(client_id_ret);
|
free(client_id_ret);
|
||||||
|
|
||||||
XCloseDisplay(dpy);
|
XCloseDisplay(dpy);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return wxEmptyString;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user