mirror of
https://github.com/anope/anope.git
synced 2026-06-28 01:56:38 +02:00
Check that the list of items isn't NULL when destructing types
This commit is contained in:
+7
-6
@@ -125,13 +125,14 @@ Type::Type(const Anope::string &n, unserialize_func f, Module *o) : name(n), un
|
||||
Type::~Type()
|
||||
{
|
||||
/* null the type of existing serializable objects of this type */
|
||||
for (std::list<Serializable *>::iterator it = Serializable::SerializableItems->begin(); it != Serializable::SerializableItems->end(); ++it)
|
||||
{
|
||||
Serializable *s = *it;
|
||||
if (Serializable::SerializableItems != NULL)
|
||||
for (std::list<Serializable *>::iterator it = Serializable::SerializableItems->begin(); it != Serializable::SerializableItems->end(); ++it)
|
||||
{
|
||||
Serializable *s = *it;
|
||||
|
||||
if (s->s_type == this)
|
||||
s->s_type = NULL;
|
||||
}
|
||||
if (s->s_type == this)
|
||||
s->s_type = NULL;
|
||||
}
|
||||
|
||||
std::vector<Anope::string>::iterator it = std::find(TypeOrder.begin(), TypeOrder.end(), this->name);
|
||||
if (it != TypeOrder.end())
|
||||
|
||||
Reference in New Issue
Block a user