title: Accessing class member creates access violation
body: <p>i have a QT cpp class defined as such:</p>
  <pre><code>class signalTapSignalAggregator : public  QAbstractTableModel
  {
  public:
      signalTapSignalAggregator();
      void addSignalTapSignal(signalTapSignal &amp;signalTapSignalInst);
      int rowCount(const QModelIndex &amp; parent = QModelIndex()) const;
      int columnCount(const QModelIndex &amp; parent = QModelIndex()) const;
      QVariant data(const QModelIndex &amp; index, int role = Qt::DisplayRole) const;
      int numberOfRow;
  private:
      QVector&lt;signalTapSignal&gt; listOfSignals;
  
  };
  
  
  
  signalTapSignalAggregator::signalTapSignalAggregator()
  {
  numberOfRow = 0;
  }
  
  void signalTapSignalAggregator::addSignalTapSignal(signalTapSignal &amp;signalTapSignalInst){
  int sizeOfSignal = signalTapSignalInst.getSignalLength();
  if(sizeOfSignal &gt;= 0){
      try{
          numberOfRow= signalTapSignalInst.getSignalLength();
      }catch(std::exception&amp; e)
      {
          qDebug() &lt;&lt; &quot;Caught Exception&quot; ;
  
      }
  }
  listOfSignals.push_back(signalTapSignalInst);
  }
  
  int signalTapSignalAggregator::rowCount(const QModelIndex &amp; parent) const{
  return numberOfRow;
  }
  
   int signalTapSignalAggregator::columnCount(const QModelIndex &amp; parent) const{
  return listOfSignals.size();
   }
  
  QVariant signalTapSignalAggregator::data(const QModelIndex &amp; index, int role) const{
  QString fieldName;
  
  switch(role){
      case Qt::DisplayRole:
  
          fieldName = listOfSignals.at(index.column()).feildName;
  
          break;
      case Qt::DecorationRole:
          break;
      case Qt::EditRole:
          break;
      case Qt::ToolTipRole:
          break;
      case Qt::StatusTipRole:
          break;
      case Qt::WhatsThisRole:
          break;
      case Qt::SizeHintRole:
          break;
  }
  
  return fieldName;
  }
  </code></pre>
  <p>The function addSignalTapSignal is invoking a access violation when i attemp to set member variable numberOfRow in the function addSignalTapSignal()</p>
  <p>The error message i recieve is:</p>
  <blockquote>
  <p>The inferior stopped because it triggered an exception</p>
  <p>Stopped in thread 0 by: Exception as 0x7ff6c2a586ac, code 0xC0000005: write access violation at 0x1, flags=0x0.</p>
  </blockquote>
  <p>from my perspective all i am doing is trying to write to a member variable in the class signalTapSignalAggregator</p>
  <p>I have no clue what i am doing wrong...</p>
  <p>I have a suspicion that the instance of the class signalTapSignalAggregator has not been initialized correctly...</p>
  <pre><code>signalTapSignalAggregator *signalTapSignalAggregatorInst = new signalTapSignalAggregator();
  signalTapParser *signalTapParserInst = new signalTapParser(signalTapSignalAggregatorInst);
  </code></pre>
  <p>the class signalTapParser has  refrence to signalTapSignalAggregator and it calls the method addSignalTapSignal() and the access violation occurs when i the function addSignalTapSignal() is invoked...</p>