workaround wx.Yield re-entrance