rem: if (menuPtr->menuFlags & MENU_RECONFIGURE_PENDING) {
add: if (!(menuPtr->menuFlags & MENU_RECONFIGURE_PENDING)) { menuPtr->menuFlags |= MENU_RECONFIGURE_PENDING;
context: TkpSetWindowMenuBar(tkwin, menuPtr)    Tk_Window tkwin;	    /* The window we are putting the menubar into.*/    TkMenu *menuPtr;	    /* The menu we are inserting */{    HMENU winMenuHdl;    ThreadSpecificData *tsdPtr = (ThreadSpecificData *)             Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));    if (menuPtr != NULL) {	Tcl_HashEntry *hashEntryPtr;	int newEntry;	winMenuHdl = (HMENU) menuPtr->platformData;	hashEntryPtr = Tcl_FindHashEntry(&tsdPtr->winMenuTable,                 (char *) winMenuHdl);	Tcl_DeleteHashEntry(hashEntryPtr);	DestroyMenu(winMenuHdl);	winMenuHdl = CreateMenu();	hashEntryPtr = Tcl_CreateHashEntry(&tsdPtr->winMenuTable,                 (char *) winMenuHdl, &newEntry);	Tcl_SetHashValue(hashEntryPtr, (char *) menuPtr);	menuPtr->platformData = (TkMenuPlatformData) winMenuHdl;	TkWinSetMenu(tkwin, winMenuHdl);	if (menuPtr->menuFlags & MENU_RECONFIGURE_PENDING) {	    Tcl_DoWhenIdle(ReconfigureWindowsMenu, (ClientData) menuPtr);	    menuPtr->menuFlags |= MENU_RECONFIGURE_PENDING;	}    } else {	TkWinSetMenu(tkwin, NULL);    }}