Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Christian Butz
VTK
Commits
8ae60a79
Commit
8ae60a79
authored
Nov 12, 2001
by
Brad King
Browse files
ENH: TclCommand now creates its own copy of the command string when SetStringCommand is called.
parent
d36303ec
Changes
3
Hide whitespace changes
Inline
Side-by-side
Common/vtkTclUtil.cxx
View file @
8ae60a79
...
...
@@ -583,7 +583,14 @@ vtkTclCommand::vtkTclCommand()
vtkTclCommand
::~
vtkTclCommand
()
{
delete
[]
this
->
StringCommand
;
if
(
this
->
StringCommand
)
{
delete
[]
this
->
StringCommand
;
}
}
void
vtkTclCommand
::
SetStringCommand
(
const
char
*
arg
)
{
if
(
this
->
StringCommand
)
{
delete
[]
this
->
StringCommand
;
}
this
->
StringCommand
=
new
char
[
strlen
(
arg
)
+
1
];
strcpy
(
this
->
StringCommand
,
arg
);
}
void
vtkTclCommand
::
Execute
(
vtkObject
*
,
unsigned
long
,
void
*
)
...
...
Common/vtkTclUtil.h
View file @
8ae60a79
...
...
@@ -91,7 +91,7 @@ public:
~
vtkTclCommand
();
static
vtkTclCommand
*
New
()
{
return
new
vtkTclCommand
;
};
void
SetStringCommand
(
char
*
arg
)
{
this
->
StringCommand
=
arg
;
}
;
void
SetStringCommand
(
const
char
*
arg
);
void
SetInterp
(
Tcl_Interp
*
interp
)
{
this
->
Interp
=
interp
;
};
void
Execute
(
vtkObject
*
,
unsigned
long
,
void
*
);
...
...
Wrapping/vtkWrapTcl.c
View file @
8ae60a79
...
...
@@ -691,7 +691,7 @@ void vtkParseOutput(FILE *fp, FileInfo *data)
fprintf
(
fp
,
" if ((!strcmp(
\"
AddObserver
\"
,argv[1]))&&(argc == 4))
\n
{
\n
"
);
fprintf
(
fp
,
" vtkTclCommand *cbc = new vtkTclCommand;
\n
"
);
fprintf
(
fp
,
" cbc->SetInterp(interp);
\n
"
);
fprintf
(
fp
,
" cbc->SetStringCommand(
strcpy(new char [strlen(argv[3])+1],argv[3])
);
\n
"
);
fprintf
(
fp
,
" cbc->SetStringCommand(
argv[3]
);
\n
"
);
fprintf
(
fp
,
" unsigned long temp20;
\n
"
);
fprintf
(
fp
,
" temp20 = op->AddObserver(argv[2],cbc);
\n
"
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment