Hello!
I have the permanent segfault when I try to manually delete pointers from my hash table.
Here is some code.

This is the class that I use as hash table value:

Qt Code:
  1. class CMarkupPair: public QObject
  2. {
  3. Q_OBJECT
  4.  
  5. public:
  6.  
  7. QHash <QString, QString> pattern;
  8. };
To copy to clipboard, switch view to plain text mode 

And thats my table:

Qt Code:
  1. QHash <QString, CMarkupPair*> hs_markup;
To copy to clipboard, switch view to plain text mode 

I tried many ways to delete values from here. For example:

Qt Code:
  1. QList<CMarkupPair *> l = hs_markup.values();
  2. foreach (CMarkupPair *p, l)
  3. delete p;
To copy to clipboard, switch view to plain text mode 

Or, even worse:

Qt Code:
  1. QList <QString> hs_markup_keys = hs_markup.keys();
  2.  
  3. foreach (QString key, hs_markup_keys)
  4. {
  5. CMarkupPair *p = hs_markup.take (key);
  6. delete p;
  7. }
To copy to clipboard, switch view to plain text mode 

And when I try to "delete p", I have the segfault. My "p" is not NULL, it's ok pointer. Please help