summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-08-01 08:47:37 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-08-01 08:47:37 (GMT)
commit6c208deebcce1a0d90a5721f7a5f96213c26e147 (patch)
tree20bd2e631b2077552b038907affec50e4265eb6b /generic
parent771103dda69711d0ecde7e072cdfdafdecebf5de (diff)
downloadtk-6c208deebcce1a0d90a5721f7a5f96213c26e147.zip
tk-6c208deebcce1a0d90a5721f7a5f96213c26e147.tar.gz
tk-6c208deebcce1a0d90a5721f7a5f96213c26e147.tar.bz2
Make sure that in test-cases, Tk_DeleteOptionTable() is never called more times than the corresponding Tk_CreateOptionTable(). Although it doesn't crash now, this behavior cannot be depended on.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkTest.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/generic/tkTest.c b/generic/tkTest.c
index 03431c9..8146c69 100644
--- a/generic/tkTest.c
+++ b/generic/tkTest.c
@@ -497,11 +497,11 @@ TestobjconfigObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
static const char *const options[] = {
- "alltypes", "chain1", "chain2", "configerror", "delete", "info",
+ "alltypes", "chain1", "chain2", "chain3", "configerror", "delete", "info",
"internal", "new", "notenoughparams", "twowindows", NULL
};
enum {
- ALL_TYPES, CHAIN1, CHAIN2, CONFIG_ERROR,
+ ALL_TYPES, CHAIN1, CHAIN2, CHAIN3, CONFIG_ERROR,
DEL, /* Can't use DELETE: VC++ compiler barfs. */
INFO, INTERNAL, NEW, NOT_ENOUGH_PARAMS, TWO_WINDOWS
};
@@ -720,7 +720,8 @@ TestobjconfigObjCmd(
break;
}
- case CHAIN2: {
+ case CHAIN2:
+ case CHAIN3: {
ExtensionWidgetRecord *recordPtr;
static const Tk_OptionSpec extensionSpecs[] = {
{TK_OPTION_STRING, "-three", "three", "Three", "three",
@@ -803,6 +804,9 @@ TestobjconfigObjCmd(
}
if (tables[index] != NULL) {
Tk_DeleteOptionTable(tables[index]);
+ /* Make sure that Tk_DeleteOptionTable() is never done
+ * twice for the same table. */
+ tables[index] = NULL;
}
break;