ListStoreModel clear() seems to be corrupted nearby memory



I am experiencing a weird memory situation related to the clearing of
a ListStore Model.

NUM_MUXES = 8; and NUM_CORES = 6

      Gtk::TreeModel::ColumnRecord ChipByteSelColumnRecord[NUM_MUXES];
      Gtk::TreeModelColumn<std::string> ChipByteSelColumnString[NUM_MUXES];
      Gtk::TreeModelColumn<std::string> ChipByteSelTMuxOutString[NUM_MUXES];
      Gtk::TreeModelColumn<int> ChipByteSelColumnRegSelValue[NUM_MUXES];
      Gtk::TreeModelColumn<int> ChipByteSelColumnBusSize[NUM_MUXES];
      Gtk::TreeModelColumn<int> ChipByteSelColumnBusLocationFlag[NUM_MUXES];
      Gtk::TreeModelColumn<int>
ChipByteSelColumnBlockSelCmbBoxMuxNum[NUM_MUXES];


      Glib::RefPtr<Gtk::ListStore> PtrChipByteSelModel[NUM_MUXES];
      std::string ActiveCoreByteSel[NUM_MUXES][NUM_CORES];



CoreByteSelColumnRecord[x][i].add(CoreByteSelColumnString[x][i]);

CoreByteSelColumnRecord[x][i].add(CoreByteSelTMuxOutString[x][i]);

CoreByteSelColumnRecord[x][i].add(CoreByteSelColumnRegSelValue[x][i]);

CoreByteSelColumnRecord[x][i].add(CoreByteSelColumnBusSize[x][i]);

CoreByteSelColumnRecord[x][i].add(CoreByteSelColumnBusLocationFlag[x][i]);

CoreByteSelColumnRecord[x][i].add(CoreByteSelColumnBlockSelCmbBoxMuxNum[x][i]);
                PtrCoreByteSelModel[x][i] =
Gtk::ListStore::create(CoreByteSelColumnRecord[x][i]);


this->PtrCmbBoxCoreByteSel[x][i] = manage(new
Gtk::ComboBox(PtrCoreByteSelModel[x][i]));


//this function below is looking to save off the String name into a
matrix called ActiveCoreByteSel

    int i,x;
    std::string strName;
    for(i=0;i<NUM_CORES;i++)
    {
        for(x=0;x<NUM_MUXES;x++)
        {
            Gtk::TreeModel::iterator treeIter =
PtrCmbBoxCoreByteSel[x][i]->get_active();
            if(treeIter)
            {

                Gtk::TreeModel::Row row = *treeIter;
                strName = row[CoreByteSelColumnString[x][i]];

                ActiveCoreByteSel[x][i] = strName;


            }
            else
            {
                ActiveCoreByteSel[x][i] = "";
            }
            if(PtrCoreByteSelModel[x][i] != 0)//NULL)
            {

                PtrCoreByteSelModel[x][i]->clear();
            }

        }
    }


What I am seeing is the ActiveCoreByteSel matrix which is containing a
local copy of the std::string obtained from the ColumnString is being
set to  "" after clear is being called. This seems weird to me because
there is no direct association between the two except for the
row[CoreByteSelColumnString[x][i]];

Can someone point me in the right direction on this, when trying to
step into the clear function I am not able to see where the data is
getting reset.

Thanks,

Josh Sinykin
jsinykin at gmail dot com


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]