public DisposeContext ( TbsContext c ) : void | ||
c | TbsContext | |
return | void |
public void DisposeContext(TbsContext c)
{
lock (this)
{
foreach (ObjectContext o in ContextManager.ObjectContexts)
{
if (o.Owner != c)
{
continue;
}
if (o.Loaded)
{
Tpm.FlushContext(o.TheTpmHandle);
o.Loaded = false;
}
else
{
if (o.TheSlotType == SlotType.SessionSlot)
{
// TODO: Need to flush saved sessions?
// Tpm.FlushContext(o.TheTpmHandle);
Tpm.FlushContext(o.Context.savedHandle);
}
}
}
ContextManager.RemoveAll(c);
}
}
protected sealed override void Dispose(bool disposing) { if (disposing) { Tbs.DisposeContext(this); } base.Dispose(disposing); }