2 Copyright (c) 2006-2008 Paolo Capriotti <p.capriotti@gmail.com>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
13 #include "loader/context.h"
18 Context::Cache
Context::s_cache
;
21 void Context::flush() {
22 for(KeySet::iterator i
= m_references
.begin();
23 i
!= m_references
.end(); ) {
24 Cache::iterator cit
= s_cache
.find(*i
);
25 Q_ASSERT(cit
!= s_cache
.end());
26 Q_ASSERT(cit
->second
.m_ref_count
> 0);
28 m_references
.erase(i
++);
30 if( !--cit
->second
.m_ref_count
)
38 Q_ASSERT(m_references
.empty());
41 } //end namespace Loader