+#ifdef USE_PTHREADS
+ /*
+ * Discard any prescreen data which is not used for the current screen.
+ */
+ _nc_lock_global(screen);
+ {
+ PRESCREEN_LIST *p;
+ pthread_t id = GetThreadID();
+ for (p = _nc_prescreen.allocated; p != 0; p = p->next) {
+ if (p->id == id && p->sp != CURRENT_SCREEN) {
+ FreeAndNull(p->sp);
+ }
+ }
+ }
+ _nc_unlock_global(screen);
+#endif