ApplicationCommandTarget again

i have a question: inside perform is good if a command invokeDirectly another command in the same perform ? or is better to call invoke from the command manager ?

while debugging i found this:

[code]bool ApplicationCommandTarget::invoke (const InvocationInfo& info, const bool async)
ApplicationCommandTarget* target = this;
int depth = 0;

while (target != 0)
    if (target->tryToInvoke (info, async))
        return true;

    target = target->getNextCommandTarget();

    jassert (depth < 100); // could be a recursive command chain??
    jassert (target != this); // definitely a recursive command chain!

    if (depth > 100 || target == this)

if (target == 0)
    target = JUCEApplication::getInstance();

    if (target != 0)
        return target->tryToInvoke (info, async);

return false;


shouldn’t depth be incremented before asserting ?

Can’t think of any reason not to call invokeDirectly inside another call…

(And ahem… yes, thankyou for noticing that bugette!)

the depth stuff is also in the function before that, i don’t think it will be reached most of the running time but just to notice