Tk Source Code

Check-in [bda8f8dc]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:3574893 Add overlooked toplevel ref count maintenance in the [wm manage|forget] operations that could cause segfaults due to premature free of structs.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: bda8f8dc8600fd52610c1d6beabe0ee485b52347
User & Date: dgp 2012-10-24 19:21:41
Context
2012-11-05
21:00
merge changes check-in: e96893dd user: dgp tags: trunk
2012-10-24
19:21
3574893 Add overlooked toplevel ref count maintenance in the [wm manage|forget] operations that could cause segfaults due to premature free of structs. check-in: bda8f8dc user: dgp tags: trunk
19:03
3574893 Add overlooked toplevel ref count maintenance in the [wm manage|forget] operations that could cause segfaults due to premature free of structs. check-in: 0e4d8eb0 user: dgp tags: core-8-5-branch
2012-10-23
13:37
sync nmakehlp.c with Tcl version

purge spaces at end of lines

clean-up unix/Makefile.in after carbon removal

check-in: e67c5c61 user: jan.nijtmans tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.







1
2
3
4
5
6
7






2012-09-19  Jan Nijtmans  <[email protected]>

	* win/Makefile.in:    Compile win32 binaries with -DTCL_NO_DEPRECATED
	* win/tkiWinWm.c:     Fix gcc compiler warning.

2012-09-17  Don Porter  <[email protected]>

>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
2012-10-24  Don Porter  <[email protected]>

	* macosx/tkMacOSXWm.c:	[Bug 3574893] Add overlooked toplevel ref
	count maintenance in the [wm manage|forget] operations that could
	cause segfaults due to premature free of structs.

2012-09-19  Jan Nijtmans  <[email protected]>

	* win/Makefile.in:    Compile win32 binaries with -DTCL_NO_DEPRECATED
	* win/tkiWinWm.c:     Fix gcc compiler warning.

2012-09-17  Don Porter  <[email protected]>

Changes to macosx/tkMacOSXWm.c.

1655
1656
1657
1658
1659
1660
1661

1662

1663
1664
1665
1666
1667
1668
1669
	Tk_MakeWindowExist(winPtr->parentPtr);

	macWin = (MacDrawable *) winPtr->window;

    	TkFocusJoin(winPtr);
    	Tk_UnmapWindow(frameWin);


	macWin->toplevel = winPtr->parentPtr->privatePtr->toplevel;

	macWin->flags &= ~TK_HOST_EXISTS;

	TkWmDeadWindow(winPtr);
	RemapWindows(winPtr, (MacDrawable *) winPtr->parentPtr->window);

	winPtr->flags &= ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED);








>

>







1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
	Tk_MakeWindowExist(winPtr->parentPtr);

	macWin = (MacDrawable *) winPtr->window;

    	TkFocusJoin(winPtr);
    	Tk_UnmapWindow(frameWin);

	macWin->toplevel->referenceCount--;
	macWin->toplevel = winPtr->parentPtr->privatePtr->toplevel;
	macWin->toplevel->referenceCount++;
	macWin->flags &= ~TK_HOST_EXISTS;

	TkWmDeadWindow(winPtr);
	RemapWindows(winPtr, (MacDrawable *) winPtr->parentPtr->window);

	winPtr->flags &= ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED);

2444
2445
2446
2447
2448
2449
2450

2451

2452
2453
2454
2455
2456
2457
2458
		macWin = (MacDrawable *) winPtr->window;
	    }
	    TkWmMapWindow(winPtr);
	    Tk_UnmapWindow(frameWin);
	}
	wmPtr = winPtr->wmInfoPtr;
	winPtr->flags &= ~TK_MAPPED;

	macWin->toplevel = macWin;

	RemapWindows(winPtr, macWin);
	winPtr->flags |=
		(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED);
	TkMapTopFrame(frameWin);
    } else if (Tk_IsTopLevel(frameWin)) {
	/* Already managed by wm - ignore it */
    }







>

>







2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
		macWin = (MacDrawable *) winPtr->window;
	    }
	    TkWmMapWindow(winPtr);
	    Tk_UnmapWindow(frameWin);
	}
	wmPtr = winPtr->wmInfoPtr;
	winPtr->flags &= ~TK_MAPPED;
	macWin->toplevel->referenceCount--;
	macWin->toplevel = macWin;
	macWin->toplevel->referenceCount++;
	RemapWindows(winPtr, macWin);
	winPtr->flags |=
		(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED);
	TkMapTopFrame(frameWin);
    } else if (Tk_IsTopLevel(frameWin)) {
	/* Already managed by wm - ignore it */
    }
6595
6596
6597
6598
6599
6600
6601

6602

6603
6604
6605
6606
6607
6608
6609
     * Remove the OS specific window. It will get rebuilt when the window gets
     * Mapped.
     */

    if (winPtr->window != None) {
	MacDrawable *macWin = (MacDrawable *) winPtr->window;


	macWin->toplevel = parentWin->toplevel;

	winPtr->flags &= ~TK_MAPPED;
#ifdef TK_REBUILD_TOPLEVEL
	winPtr->flags |= TK_REBUILD_TOPLEVEL;
#endif
    }

    /* Repeat for all the children */







>

>







6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
     * Remove the OS specific window. It will get rebuilt when the window gets
     * Mapped.
     */

    if (winPtr->window != None) {
	MacDrawable *macWin = (MacDrawable *) winPtr->window;

	macWin->toplevel->referenceCount--;
	macWin->toplevel = parentWin->toplevel;
	macWin->toplevel->referenceCount++;
	winPtr->flags &= ~TK_MAPPED;
#ifdef TK_REBUILD_TOPLEVEL
	winPtr->flags |= TK_REBUILD_TOPLEVEL;
#endif
    }

    /* Repeat for all the children */