title: QT debug error r6010 abort has been called while running perfectly
body: <p>I am trying to generate QWTspectrogram using a file. there are 500 binary files to show an annimation with a slider in UI. the program works fine but sometimes it gives "debug error r6010 abort has been called" error and crashes on any random occasion I have no idea why this shows up because it is random however it depends on the change in fnum as slider moves but not at any fixed value or time(it does not appear at stationary condition). below is the code for my program</p>
  
  <p>setAlpha is changed with the change in slider of UI.</p>
  
  <pre><code>void Plot::setAlpha( int alpha )
  {
      fnum=alpha;
      d_spectrogram-&gt;setData( new mydata(fnum,dial) );
      d_spectrogram-&gt;attach( this );
      replot();
  }
  
  class mydata: public QwtRasterData
  {
      typedef signed short int sBYTE;
      char filepath[35]; 
      sBYTE *fileBuf;    
      FILE *file = NULL; 
  public:
  
      mydata(int fnum, int dial)
      {
          setInterval( Qt::XAxis, QwtInterval( 0, (area)-1 ) );
          setInterval( Qt::YAxis, QwtInterval( 0, (area)-1 ) );
          setInterval( Qt::ZAxis, QwtInterval( -dial, dial ) );
  
          {
              sprintf_s(filepath, "c:/mydata/uwpi%d.bin", fnum);
              fopen_s(&amp;file,filepath, "rb");
              long fileSize = getFileSizex(file);
              fileBuf = new sBYTE[fileSize];
              fread(fileBuf, fileSize, 1, file);
              fclose(file);
          }
      }
  
      virtual double value( double x, double y ) const
      {
  
          int x_pos = static_cast&lt;int&gt;(x);
          int y_pos = static_cast&lt;int&gt;(y);
          const double c =  (fileBuf[ ((x_pos)+((area-y_pos)*area))]);
          return c;
      }
  }
  </code></pre>