mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-20 16:10:29 +00:00
trace: disable tracing when owner disappears
* Disable trace source and release ownership on subject destruction. * Note, since the policy module is also destroyed on descruction of the session component, the traced component must not access the policy module when acknowledging the disabled state (else: page fault). Fixes genodelabs/genode#4247
This commit is contained in:
committed by
Christian Helmuth
parent
81d939f947
commit
5e284bfb35
@ -189,6 +189,19 @@ class Genode::Trace::Subject
|
||||
_label(label), _name(name)
|
||||
{ }
|
||||
|
||||
/**
|
||||
* Destructor, releases ownership of associated source
|
||||
*/
|
||||
~Subject()
|
||||
{
|
||||
Locked_ptr<Source> source(_source);
|
||||
|
||||
if (source.valid()) {
|
||||
source->disable();
|
||||
source->release_ownership(*this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return registry-local ID
|
||||
*/
|
||||
|
Reference in New Issue
Block a user