Ingo Weinhold <bonefish@xxxxxxxxxxxxxxx> wrote: > BTW, that reminds me of our BTokenSpace, which reuses tokens of > deleted > objects. Hence the following situation can occur: A BHandler is > created > and added to a looper. A BMessenger referring to the handler is > created. > The handler is removed from the looper and deleted. The next handler > will > be created with the same token, and therefore the formerly > constructed > messenger will now address another handler (when being added to the > same > looper). This is not *that* bad, but the effects may nevertheless be > undesirable. I would consider this as bad, because the new handler would get messages that it shouldn't get. > As a solution I would get rid of the stack collecting tokens of > deleted > objects and let NewToken() always return a new token. For the quite > unlikely case, that the token counter hits the maximum, it should > restart > from 0 again and set a flag, that from then on NewToken() must first > check Although I would consider 32-bit as enough for this time (if any application used all 4 billion IDs, it deserves to die ;-)), but we could as well just use 64-bit values and consider us in a safe place. Of course, using Ingo's method would also work nicely, and since we also have to be binary compatible with R5, this should be the best solution :-) Adios... Axel.