Path: news.mathworks.com!not-for-mail
From: "Kenneth Eaton" <Kenneth.dot.Eaton@cchmc.dot.org>
Newsgroups: comp.soft-sys.matlab
Subject: Deleting timers from within their StopFcn
Date: Fri, 5 Dec 2008 20:55:06 +0000 (UTC)
Organization: Cincinnati Children's Hospital Research Center
Lines: 5
Message-ID: <ghc4fa$6p5$1@fred.mathworks.com>
Reply-To: "Kenneth Eaton" <Kenneth.dot.Eaton@cchmc.dot.org>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1228510506 6949 172.30.248.35 (5 Dec 2008 20:55:06 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 5 Dec 2008 20:55:06 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1165924
Xref: news.mathworks.com comp.soft-sys.matlab:505288


Looking over the examples The MathWorks gives for using timers, I noticed that they are always deleted after being used (a good practice). However, I was curious if you could just delete a timer from within it's own StopFcn, so that it would delete itself upon completing its task. I tested it a few times and it seems to work just fine.

Since I've never seen an example of this being done, I was just curious if anyone knew of any unforeseen reason why this would be a bad thing to do?

Ken