fix X11 segfault
Merge pull request #664 from LipuFei/fix-x11segfault

Fix X11 Segfault