[Fresco-devel] kit destruction not informing the server?
Nick Lewycky <[email protected]>
| Newsgroups | gmane.comp.video.fresco.devel |
|---|---|
| Message-ID | <[email protected]> |
I'm tracking down the problem where clicking the Print button twice causes the server to crash. The problem is that the server context thinks it has a pointer to a valid postscript drawing kit when it doesn't. KitImpl::decrement calls ~KitImpl when it detects that its own usage count is zero. Unfortunately, nobody ever bothers to tell the server context about that, so it never removes it from ServerContextImpl::_kits. The only time it ever removes an entry from _kits is in its own destructor, which means that the server is being shut down. I've heard that this lifecycle stuff can be complicated so I'm asking what the correct fix is. I see two options: a) make the ServerContextImpl test that the kit is still valid before trying to make calls on it. (Not certain myself how to do that.) b) make the KitImpl hold on to a ServerContext_var and add a function to the API that allows the Kit to inform the server context that the kit is now gone Or is there supposed to be another mechanism that I simply failed to notice? I have a hard time believing that kit destruction never worked. Nick Lewycky