g_height should be volatile