| Description: |
OriginalBugID: 4405 Bug
Version: 8.3
SubmitDate: '2000-03-20'
LastModified: '2000-03-27'
Severity: SER
Status: Released
Submitter: techsupp
ChangedBy: ericm
OS: All Unix
FixedDate: '2000-03-27'
FixedInVersion: 8.3.1
Name:
Huver Hu
ReproducibleScript:
keep on creating new children top-levels with the same group leader.
ObservedBehavior:
a few of the places where allocated memory are not freed.
DesiredBehavior:
see diff attached.
Patch:
*** tkUnixWm.c.orig Thu Feb 10 02:53:19 2000
--- tkUnixWm.c Wed Feb 23 21:40:38 2000
***************
*** 1230,1235 ****
--- 1230,1238 ----
}
wmPtr->hints.window_group = Tk_WindowId(wmPtr2->wrapperPtr);
wmPtr->hints.flags |= WindowGroupHint;
+ if (wmPtr->leaderName != NULL) {
+ ckfree((char *) wmPtr->leaderName);
+ }
wmPtr->leaderName = ckalloc((unsigned) (strlen(argv[3])+1));
strcpy(wmPtr->leaderName, argv[3]);
}
***************
*** 1354,1359 ****
--- 1357,1365 ----
TCL_STATIC);
return TCL_OK;
} else {
+ if (wmPtr->iconName != NULL) {
+ ckfree((char *) wmPtr->iconName);
+ }
wmPtr->iconName = ckalloc((unsigned) (strlen(argv[3]) + 1));
strcpy(wmPtr->iconName, argv[3]);
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
***************
*** 1847,1852 ****
--- 1853,1861 ----
TCL_STATIC);
return TCL_OK;
} else {
+ if (wmPtr->title != NULL) {
+ ckfree((char *) wmPtr->title);
+ }
wmPtr->title = ckalloc((unsigned) (strlen(argv[3]) + 1));
strcpy(wmPtr->title, argv[3]);
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
***************
*** 1903,1908 ****
--- 1912,1920 ----
CreateWrapper(wmPtr2);
}
wmPtr->master = Tk_WindowId(wmPtr2->wrapperPtr);
+ if (wmPtr->masterWindowName != NULL) {
+ ckfree((char *) wmPtr->masterWindowName);
+ }
wmPtr->masterWindowName = ckalloc((unsigned) (strlen(argv[3])+1));
strcpy(wmPtr->masterWindowName, argv[3]);
}
PatchFiles:
unix/tkUnixWm.c
Good find, and thanks for the patch. I applied it to the CVS repository. The fix will go out with Tcl/Tk 8.3.1.
- eric
-- 03/27/2000 ericm
|