Kill off allCatalogs list.

No longer needed, and fixes crash on shutdown.
This commit is contained in:
James Turner
2015-02-20 11:31:15 +00:00
parent e5995208a9
commit 611785c04b
3 changed files with 83 additions and 95 deletions
-10
View File
@@ -36,8 +36,6 @@ namespace simgear {
namespace pkg { namespace pkg {
CatalogList static_catalogs;
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
class Catalog::Downloader : public HTTP::Request class Catalog::Downloader : public HTTP::Request
@@ -112,22 +110,14 @@ private:
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
CatalogList Catalog::allCatalogs()
{
return static_catalogs;
}
Catalog::Catalog(Root *aRoot) : Catalog::Catalog(Root *aRoot) :
m_root(aRoot), m_root(aRoot),
m_retrievedTime(0) m_retrievedTime(0)
{ {
static_catalogs.push_back(this);
} }
Catalog::~Catalog() Catalog::~Catalog()
{ {
CatalogList::iterator it = std::find(static_catalogs.begin(), static_catalogs.end(), this);
static_catalogs.erase(it);
} }
CatalogRef Catalog::createFromUrl(Root* aRoot, const std::string& aUrl) CatalogRef Catalog::createFromUrl(Root* aRoot, const std::string& aUrl)
-2
View File
@@ -60,8 +60,6 @@ public:
static CatalogRef createFromPath(Root* aRoot, const SGPath& aPath); static CatalogRef createFromPath(Root* aRoot, const SGPath& aPath);
static CatalogList allCatalogs();
Root* root() const Root* root() const
{ return m_root;}; { return m_root;};
+1 -1
View File
@@ -122,7 +122,7 @@ int main(int argc, char** argv)
root->setDelegate(&dlg); root->setDelegate(&dlg);
cout << "Package root is:" << Dir::current().path() << endl; cout << "Package root is:" << Dir::current().path() << endl;
cout << "have " << pkg::Catalog::allCatalogs().size() << " catalog(s)" << endl; cout << "have " << root->catalogs().size() << " catalog(s)" << endl;
root->setHTTPClient(http); root->setHTTPClient(http);