Kill off allCatalogs list.
No longer needed, and fixes crash on shutdown.
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -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;};
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user