2013-04-11 7 views
0

1 주일부터 Qt 응용 프로그램이 작동하지 않습니다. 나는이 힙 손상, 액세스 위반 등등에 익숙하지 않았습니다. 이제 나는 그것이 "아프다"는 것을 안다.) -Qt 응용 프로그램 : VERIFIER STOP 00000013 : 현재 스택 추적을위한 첫 번째 기회 액세스 위반

한편 애플리케이션 검증자를 설치했다. VS2010, Qt 4.8.4, qwt 6.0.0을 사용하고 있습니다. 이제 GUI 클래스를 최소화하고 응용 프로그램 검증자를 통해 액세스 위반이 발생했습니다. 이것은 GUI 코드 :

#include "mygui.h" 
#include <QtGui/QApplication> 

int main(int argc, char *argv[]) 
{ 
    QApplication a(argc, argv); 
    MYGUI w; 
    w.show(); 
    return a.exec(); 
} 

mygui.h :

#ifndef PFEGUI_H 
#define PFEGUI_H 

#include <QtGui/QMainWindow> 
#include "ui_mygui.h" 

#include <myengine.hpp> 

class MYGUI : public QMainWindow 
{ 
    Q_OBJECT 

public: 
    MYGUI(QWidget *parent = 0, Qt::WFlags flags = 0); 
    ~MYGUI(); 

    Ui::MYGUIClass ui; 

private: 
    boost::shared_ptr<MYengine> myEngine_; 
    boost::shared_ptr<QMenu> treeWidgetMenu_; 
    boost::shared_ptr<QAction> treeWidgetMenuDeleteAction_; 

}; 

mygui.cpp :

#include "mygui.h" 

MYGUI::MYGUI(QWidget *parent, Qt::WFlags flags) 
    : QMainWindow(parent, flags) 
{ 
    ui.setupUi(this); 
    myEngine_ = boost::shared_ptr<MYengine>(new MYengine()); 
} 

MYGUI::~MYGUI() {} 

및 대형 자동 생성 ui_mygui.h을 (때문에 생략 문자 제한 가운데 일부) :

/******************************************************************************** 
** Form generated from reading UI file 'mygui.ui' 
** 
** Created: Thu 11. Apr 22:55:21 2013 
**  by: Qt User Interface Compiler version 4.8.4 
** 
** WARNING! All changes made in this file will be lost when recompiling UI file! 
********************************************************************************/ 

#ifndef UI_MYGUI_H 
#define UI_MYGUI_H 

#include <QtCore/QVariant> 
#include <QtGui/QAction> 
#include <QtGui/QApplication> 
#include <QtGui/QButtonGroup> 
#include <QtGui/QCheckBox> 
#include <QtGui/QComboBox> 
#include <QtGui/QDateEdit> 
#include <QtGui/QDoubleSpinBox> 
#include <QtGui/QFormLayout> 
#include <QtGui/QFrame> 
#include <QtGui/QGridLayout> 
#include <QtGui/QGroupBox> 
#include <QtGui/QHBoxLayout> 
#include <QtGui/QHeaderView> 
#include <QtGui/QLCDNumber> 
#include <QtGui/QLabel> 
#include <QtGui/QLineEdit> 
#include <QtGui/QMainWindow> 
#include <QtGui/QMenu> 
#include <QtGui/QMenuBar> 
#include <QtGui/QProgressBar> 
#include <QtGui/QPushButton> 
#include <QtGui/QRadioButton> 
#include <QtGui/QScrollArea> 
#include <QtGui/QSlider> 
#include <QtGui/QSpacerItem> 
#include <QtGui/QSpinBox> 
#include <QtGui/QStackedWidget> 
#include <QtGui/QStatusBar> 
#include <QtGui/QTabWidget> 
#include <QtGui/QTextBrowser> 
#include <QtGui/QToolBar> 
#include <QtGui/QTreeWidget> 
#include <QtGui/QVBoxLayout> 
#include <QtGui/QWidget> 
#include "qwt_plot.h" 

QT_BEGIN_NAMESPACE 

class Ui_MYGUIClass 
{ 
public: 
    QWidget *centralWidget; 
    QTabWidget *tabWidgetMYGUI; 
    QWidget *tab; 
    QWidget *layoutWidget; 
    QVBoxLayout *verticalLayout; 
    QPushButton *pushButtonSzenarienBerechnen; 
    QPushButton *pushButtonMYBerechnen; 
    QWidget *layoutWidget1; 
    QVBoxLayout *verticalLayout_2; 
    QHBoxLayout *horizontalLayout_4; 
    QProgressBar *progressBarMY; 
    QLCDNumber *lcdNumberWatch; 
    QScrollArea *scrollAreaOutput; 
    QWidget *scrollAreaWidgetContents; 
    QGridLayout *gridLayout_6; 
    QTextBrowser *textBrowserOutput; 
    QWidget *tab_2; 
    QGroupBox *groupBox_2; 
    QGridLayout *gridLayout_5; 
    QGridLayout *gridLayout_4; 
    QPushButton *pushButtonPortfolioPfeBerechnen; 
    QTreeWidget *treeWidgetPortfolioSimPort; 
    QGroupBox *groupBox_3; 
    QGridLayout *gridLayout_2; 
    QHBoxLayout *horizontalLayout_10; 
    QLabel *label_4; 
    QComboBox *comboBoxPortfolioCtpNumbers; 
    QHBoxLayout *horizontalLayout_11; 
    QPushButton *pushButtonPortfolioShowCtp; 
    QPushButton *pushButtonPortfolioAddCtp; 
    QPushButton *pushButtonPortfolioAddAll; 
    QGroupBox *groupBox_5; 
    QGridLayout *gridLayout_10; 
    QStackedWidget *stackedWidgetPortfolioAddDeal; 
    QWidget *pageVanillaSwap; 
    QGridLayout *gridLayout_11; 
    QHBoxLayout *horizontalLayout_5; 
    QRadioButton *radioButtonPortfolioPayer; 
    QRadioButton *radioButtonPortfolioReceiver; 
    QHBoxLayout *horizontalLayout_9; 
    QLabel *label_19; 
    QSpacerItem *horizontalSpacer_2; 
    QDoubleSpinBox *doubleSpinBoxPortfolioFixRate; 
    QHBoxLayout *horizontalLayout_6; 
    QLabel *label_8; 
    QSpacerItem *horizontalSpacer; 
    QComboBox *comboBoxPortfolioIndices; 
    QFormLayout *formLayout; 
    QLabel *label_15; 
    QComboBox *comboBoxPortfolioFixFreq; 
    QLabel *label_16; 
    QComboBox *comboBoxPortfolioFloatFreq; 
    QFormLayout *formLayout_2; 
    QLabel *label_18; 
    QComboBox *comboBoxPortfolioFixDC; 
    QLabel *label_20; 
    QComboBox *comboBoxPortfolioFloatDC; 
    QSpacerItem *verticalSpacer; 
    QWidget *pagefxproducts; 
    QGridLayout *gridLayout_12; 
    QSpacerItem *verticalSpacer_2; 
    QHBoxLayout *horizontalLayout_16; 
    QLabel *label_21; 
    QDoubleSpinBox *doubleSpinBoxPortfolioFxSpot; 
    QHBoxLayout *horizontalLayout_14; 
    QLabel *label_13; 
    QDoubleSpinBox *doubleSpinBoxPortfolioForwardRate; 
    QHBoxLayout *horizontalLayout_13; 
    QLabel *label_12; 
    QComboBox *comboBoxPortfolioCurrencyPairs; 
    QHBoxLayout *horizontalLayout_8; 
    QLabel *label_11; 
    QSpinBox *spinBoxPortfolioNominal2; 
    QLabel *labelPortfolioCurrency2; 
    QComboBox *comboBoxPortfolioBuySell; 
    QHBoxLayout *horizontalLayout_7; 
    QLabel *label_10; 
    QSpacerItem *horizontalSpacer_3; 
    QLineEdit *lineEditPortfolioDealMaturity; 
    QSpacerItem *horizontalSpacer_6; 
    QDateEdit *dateEditPortfolioEndDate; 
    QHBoxLayout *horizontalLayout_12; 
    QLabel *label_9; 
    QSpacerItem *horizontalSpacer_5; 
    QDateEdit *dateEditPortfolioStartDate; 
    QHBoxLayout *horizontalLayout_2; 
    QLabel *label_6; 
    QComboBox *comboBoxPortfolioInstrumentNames; 
    QHBoxLayout *horizontalLayout_3; 
    QLabel *label_7; 
    QSpinBox *spinBoxPortfolioNominal; 
    QComboBox *comboBoxPortfolioCurrencies; 
    QPushButton *pushButtonPortfolioAddDeal; 
    QHBoxLayout *horizontalLayout; 
    QLabel *label_14; 
    QSpacerItem *horizontalSpacer_4; 
    QComboBox *comboBoxPortfolioAddDealCtpNumbers; 
    QFrame *line; 
    QHBoxLayout *horizontalLayout_15; 
    QLabel *label_17; 
    QLineEdit *lineEditPortfolioNPV; 
    QPushButton *pushButtonPortfolioCalculateNPV; 
    QComboBox *comboBoxPortfolioCtpNumbers_2; 
    QWidget *tab_3; 
    QwtPlot *qwtPlot; 
    QWidget *layoutWidget_2; 
    QHBoxLayout *horizontalLayout_18; 
    QLabel *label_23; 
    QComboBox *comboBoxAnalysisContractNumbers; 
    QWidget *layoutWidget_3; 
    QHBoxLayout *horizontalLayout_19; 
    QLabel *label_24; 
    QComboBox *comboBoxAnalysisCompNumbers; 
    QPushButton *pushButtonAnalysisPlotCtp; 
    QPushButton *pushButtonAnalysisPlotContract; 
    QPushButton *pushButtonAnalysisPlotComp; 
    QWidget *layoutWidget2; 
    QHBoxLayout *horizontalLayout_17; 
    QLabel *label_22; 
    QComboBox *comboBoxAnalysisCtpNumbers; 
    QCheckBox *checkBoxAnalysisSimulationPaths; 
    QCheckBox *checkBoxAnalysisStatisticCurves; 
    QGroupBox *groupBox_11; 
    QWidget *layoutWidget3; 
    QHBoxLayout *horizontalLayout_39; 
    QRadioButton *radioButtonAnalysisBarStyle; 
    QRadioButton *radioButtonAnalysisTubeStyle; 
    QGroupBox *groupBox_12; 
    QWidget *layoutWidget4; 
    QHBoxLayout *horizontalLayout_20; 
    QLabel *label_25; 
    QSpinBox *spinBoxAnalysisSimStep; 
    QLabel *label_26; 
    QDateEdit *dateEditAnalysisChoosenDate; 
    QPushButton *pushButtonAnalysisShowMarketData; 
    QWidget *tab_7; 
    QwtPlot *qwtPlot_2; 
    QGroupBox *groupBox_6; 
    QSpinBox *spinBoxAnalysisSimStep_2; 
    QPushButton *pushButton; 
    QPushButton *pushButton_2; 
    QPushButton *pushButton_3; 
    QPushButton *pushButton_4; 
    QWidget *OptionsTab; 
    QGroupBox *groupBox; 
    QWidget *layoutWidget5; 
    QGridLayout *gridLayout; 
    QLabel *label; 
    QSpinBox *spinBoxSimSteps; 
    QSlider *horizontalSliderSimSteps; 
    QLabel *label_2; 
    QSpinBox *spinBoxForwardSteps; 
    QSlider *horizontalSliderSimSteps_2; 
    QLabel *label_3; 
    QDoubleSpinBox *spinBoxJumpProb; 
    QGroupBox *groupBox_4; 
    QLabel *label_5; 
    QLineEdit *lineEditSettingsInstrumentFile; 
    QPushButton *pushButtonSettingsInstFileBrowse; 
    QTextBrowser *textBrowserPortfolioCtpTrades; 
    QStackedWidget *stackedWidget_2; 
    QWidget *page_3; 
    QWidget *page_4; 
    QMenuBar *menuBar; 
    QMenu *menuOptions; 
    QToolBar *mainToolBar; 
    QStatusBar *statusBar; 
    QButtonGroup *buttonGroup_2; 

    void setupUi(QMainWindow *MYGUIClass) 
    { 
     if (MYGUIClass->objectName().isEmpty()) 
      MYGUIClass->setObjectName(QString::fromUtf8("MYGUIClass")); 
     MYGUIClass->resize(1538, 777); 
     centralWidget = new QWidget(MYGUIClass); 
     centralWidget->setObjectName(QString::fromUtf8("centralWidget")); 
     tabWidgetMYGUI = new QTabWidget(centralWidget); 
     tabWidgetMYGUI->setObjectName(QString::fromUtf8("tabWidgetMYGUI")); 
     tabWidgetMYGUI->setGeometry(QRect(11, 0, 1521, 751)); 
     tabWidgetMYGUI->setIconSize(QSize(16, 16)); 
     tab = new QWidget(); 
     tab->setObjectName(QString::fromUtf8("tab")); 
     layoutWidget = new QWidget(tab); 
     layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); 
     layoutWidget->setGeometry(QRect(10, 50, 401, 62)); 
     verticalLayout = new QVBoxLayout(layoutWidget); 
     verticalLayout->setSpacing(6); 
     verticalLayout->setContentsMargins(11, 11, 11, 11); 
     verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); 
     verticalLayout->setContentsMargins(0, 0, 0, 0); 
     pushButtonSzenarienBerechnen = new QPushButton(layoutWidget); 
     pushButtonSzenarienBerechnen->setObjectName(QString::fromUtf8("pushButtonSzenarienBerechnen")); 
     pushButtonSzenarienBerechnen->setEnabled(true); 
     QFont font; 
     font.setPointSize(12); 
     font.setBold(true); 
     font.setWeight(75); 
     pushButtonSzenarienBerechnen->setFont(font); 
     pushButtonSzenarienBerechnen->setCheckable(false); 

     verticalLayout->addWidget(pushButtonSzenarienBerechnen); 

     pushButtonMYBerechnen = new QPushButton(layoutWidget); 
     pushButtonMYBerechnen->setObjectName(QString::fromUtf8("pushButtonMYBerechnen")); 
     pushButtonMYBerechnen->setEnabled(true); 
     pushButtonMYBerechnen->setFont(font); 
     pushButtonMYBerechnen->setCheckable(false); 

     verticalLayout->addWidget(pushButtonMYBerechnen); 


     verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); 

     gridLayout_11->addItem(verticalSpacer, 4, 0, 1, 1); 

     stackedWidgetPortfolioAddDeal->addWidget(pageVanillaSwap); 
     pagefxproducts = new QWidget(); 
     pagefxproducts->setObjectName(QString::fromUtf8("pagefxproducts")); 
     gridLayout_12 = new QGridLayout(pagefxproducts); 
     gridLayout_12->setSpacing(6); 
     gridLayout_12->setContentsMargins(11, 11, 11, 11); 
     gridLayout_12->setObjectName(QString::fromUtf8("gridLayout_12")); 
     verticalSpacer_2 = new QSpacerItem(20, 80, QSizePolicy::Minimum, QSizePolicy::Expanding); 



// Tons of other autogenerated stuff are deleted here 

     QTreeWidgetItem *___qtreewidgetitem = treeWidgetPortfolioSimPort->headerItem(); 
     ___qtreewidgetitem->setText(9, QApplication::translate("MYGUIClass", "MY Exposure", 0, QApplication::UnicodeUTF8)); 
     ___qtreewidgetitem->setText(8, QApplication::translate("MYGUIClass", "MY Date", 0, QApplication::UnicodeUTF8)); 
     ___qtreewidgetitem->setText(7, QApplication::translate("MYGUIClass", "MY", 0, QApplication::UnicodeUTF8)); 
     ___qtreewidgetitem->setText(6, QApplication::translate("MYGUIClass", "Maturity", 0, QApplication::UnicodeUTF8)); 
     ___qtreewidgetitem->setText(5, QApplication::translate("MYGUIClass", "int. NPV", 0, QApplication::UnicodeUTF8)); 
     ___qtreewidgetitem->setText(4, QApplication::translate("MYGUIClass", "ext. NPV", 0, QApplication::UnicodeUTF8)); 
     ___qtreewidgetitem->setText(3, QApplication::translate("MYGUIClass", "Comp Id", 0, QApplication::UnicodeUTF8)); 
     ___qtreewidgetitem->setText(2, QApplication::translate("MYGUIClass", "Contract Id", 0, QApplication::UnicodeUTF8)); 
     ___qtreewidgetitem->setText(1, QApplication::translate("MYGUIClass", "Ctp Id", 0, QApplication::UnicodeUTF8)); 
     ___qtreewidgetitem->setText(0, QApplication::translate("MYGUIClass", "Kategorie", 0, QApplication::UnicodeUTF8)); 
     groupBox_3->setTitle(QApplication::translate("MYGUIClass", "Add Counterparty", 0, QApplication::UnicodeUTF8)); 
     label_4->setText(QApplication::translate("MYGUIClass", "Counterparty number", 0, QApplication::UnicodeUTF8)); 
#ifndef QT_NO_TOOLTIP 
     pushButtonPortfolioShowCtp->setToolTip(QApplication::translate("MYGUIClass", "<html><head/><body><p>Kundenportfolio anzeigen...</p></body></html>", 0, QApplication::UnicodeUTF8)); 
#endif // QT_NO_TOOLTIP 
     pushButtonPortfolioShowCtp->setText(QApplication::translate("MYGUIClass", "Show", 0, QApplication::UnicodeUTF8)); 
     pushButtonPortfolioAddCtp->setText(QApplication::translate("MYGUIClass", "Add", 0, QApplication::UnicodeUTF8)); 
     pushButtonPortfolioAddAll->setText(QApplication::translate("MYGUIClass", "Add all", 0, QApplication::UnicodeUTF8)); 
     groupBox_5->setTitle(QApplication::translate("MYGUIClass", "Add Deal", 0, QApplication::UnicodeUTF8)); 
     radioButtonPortfolioPayer->setText(QApplication::translate("MYGUIClass", "Payer", 0, QApplication::UnicodeUTF8)); 
     radioButtonPortfolioReceiver->setText(QApplication::translate("MYGUIClass", "Receiver", 0, QApplication::UnicodeUTF8)); 
     label_19->setText(QApplication::translate("MYGUIClass", "Fix Rate (in %)", 0, QApplication::UnicodeUTF8)); 
     label_8->setText(QApplication::translate("MYGUIClass", "Index", 0, QApplication::UnicodeUTF8)); 
     label_15->setText(QApplication::translate("MYGUIClass", "Fix Freq", 0, QApplication::UnicodeUTF8)); 
     label_16->setText(QApplication::translate("MYGUIClass", "Float Freq", 0, QApplication::UnicodeUTF8)); 
     label_18->setText(QApplication::translate("MYGUIClass", "Fix DC", 0, QApplication::UnicodeUTF8)); 
     label_20->setText(QApplication::translate("MYGUIClass", "Float DC", 0, QApplication::UnicodeUTF8)); 
     label_21->setText(QApplication::translate("MYGUIClass", "Spot", 0, QApplication::UnicodeUTF8)); 
     label_13->setText(QApplication::translate("MYGUIClass", "Forward rate", 0, QApplication::UnicodeUTF8)); 
     label_12->setText(QApplication::translate("MYGUIClass", "Currency pair", 0, QApplication::UnicodeUTF8)); 
     label_11->setText(QApplication::translate("MYGUIClass", "Notional 2", 0, QApplication::UnicodeUTF8)); 
     spinBoxPortfolioNominal2->setSuffix(QString()); 
     labelPortfolioCurrency2->setText(QApplication::translate("MYGUIClass", "USD", 0, QApplication::UnicodeUTF8)); 
     label_10->setText(QApplication::translate("MYGUIClass", "Maturity", 0, QApplication::UnicodeUTF8)); 
     lineEditPortfolioDealMaturity->setInputMask(QApplication::translate("MYGUIClass", "00y + 00m;_", 0, QApplication::UnicodeUTF8)); 
     lineEditPortfolioDealMaturity->setText(QApplication::translate("MYGUIClass", "05y + 00m", 0, QApplication::UnicodeUTF8)); 
     label_9->setText(QApplication::translate("MYGUIClass", "Start date", 0, QApplication::UnicodeUTF8)); 
     label_6->setText(QApplication::translate("MYGUIClass", "Inst-Type", 0, QApplication::UnicodeUTF8)); 
     label_7->setText(QApplication::translate("MYGUIClass", "Notional", 0, QApplication::UnicodeUTF8)); 
     spinBoxPortfolioNominal->setSuffix(QString()); 
     pushButtonPortfolioAddDeal->setText(QApplication::translate("MYGUIClass", "Add", 0, QApplication::UnicodeUTF8)); 
     label_14->setText(QApplication::translate("MYGUIClass", "Kunde", 0, QApplication::UnicodeUTF8)); 
     label_17->setText(QApplication::translate("MYGUIClass", "NPV", 0, QApplication::UnicodeUTF8)); 
     lineEditPortfolioNPV->setText(QApplication::translate("MYGUIClass", "not calculated", 0, QApplication::UnicodeUTF8)); 
     pushButtonPortfolioCalculateNPV->setText(QApplication::translate("MYGUIClass", "Calculate", 0, QApplication::UnicodeUTF8)); 
     tabWidgetMYGUI->setTabText(tabWidgetMYGUI->indexOf(tab_2), QApplication::translate("MYGUIClass", "Portfolio", 0, QApplication::UnicodeUTF8)); 
     label_23->setText(QApplication::translate("MYGUIClass", "Contract number", 0, QApplication::UnicodeUTF8)); 
     label_24->setText(QApplication::translate("MYGUIClass", "Component number", 0, QApplication::UnicodeUTF8)); 
     pushButtonAnalysisPlotCtp->setText(QApplication::translate("MYGUIClass", "Plot", 0, QApplication::UnicodeUTF8)); 
     pushButtonAnalysisPlotContract->setText(QApplication::translate("MYGUIClass", "Plot", 0, QApplication::UnicodeUTF8)); 
     pushButtonAnalysisPlotComp->setText(QApplication::translate("MYGUIClass", "Plot", 0, QApplication::UnicodeUTF8)); 
     label_22->setText(QApplication::translate("MYGUIClass", "Counterparty number", 0, QApplication::UnicodeUTF8)); 
     checkBoxAnalysisSimulationPaths->setText(QApplication::translate("MYGUIClass", "Show simulated NPV Paths", 0, QApplication::UnicodeUTF8)); 
     checkBoxAnalysisStatisticCurves->setText(QApplication::translate("MYGUIClass", "Show statistics", 0, QApplication::UnicodeUTF8)); 
     groupBox_11->setTitle(QApplication::translate("MYGUIClass", "Style Statistics", 0, QApplication::UnicodeUTF8)); 
     radioButtonAnalysisBarStyle->setText(QApplication::translate("MYGUIClass", "Bars", 0, QApplication::UnicodeUTF8)); 
     radioButtonAnalysisTubeStyle->setText(QApplication::translate("MYGUIClass", "Tube", 0, QApplication::UnicodeUTF8)); 
     groupBox_12->setTitle(QApplication::translate("MYGUIClass", "Simulation Parameters", 0, QApplication::UnicodeUTF8)); 
     label_25->setText(QApplication::translate("MYGUIClass", "Sim Step", 0, QApplication::UnicodeUTF8)); 
     label_26->setText(QApplication::translate("MYGUIClass", "Date", 0, QApplication::UnicodeUTF8)); 
     pushButtonAnalysisShowMarketData->setText(QApplication::translate("MYGUIClass", "Show Market Data", 0, QApplication::UnicodeUTF8)); 
     tabWidgetMYGUI->setTabText(tabWidgetMYGUI->indexOf(tab_3), QApplication::translate("MYGUIClass", "Analysis MY", 0, QApplication::UnicodeUTF8)); 
     groupBox_6->setTitle(QApplication::translate("MYGUIClass", "GroupBox", 0, QApplication::UnicodeUTF8)); 
     pushButton->setText(QApplication::translate("MYGUIClass", "PushButton", 0, QApplication::UnicodeUTF8)); 
     pushButton_2->setText(QApplication::translate("MYGUIClass", "PushButton", 0, QApplication::UnicodeUTF8)); 
     pushButton_3->setText(QApplication::translate("MYGUIClass", "PushButton", 0, QApplication::UnicodeUTF8)); 
     pushButton_4->setText(QApplication::translate("MYGUIClass", "PushButton", 0, QApplication::UnicodeUTF8)); 
     tabWidgetMYGUI->setTabText(tabWidgetMYGUI->indexOf(tab_7), QApplication::translate("MYGUIClass", "Analysis MD", 0, QApplication::UnicodeUTF8)); 
     groupBox->setTitle(QApplication::translate("MYGUIClass", "Simulation parameters", 0, QApplication::UnicodeUTF8)); 
     label->setText(QApplication::translate("MYGUIClass", "Number of Simulation Steps", 0, QApplication::UnicodeUTF8)); 
     label_2->setText(QApplication::translate("MYGUIClass", "Number of Forward Steps", 0, QApplication::UnicodeUTF8)); 
     label_3->setText(QApplication::translate("MYGUIClass", "Jump Probability", 0, QApplication::UnicodeUTF8)); 
     groupBox_4->setTitle(QApplication::translate("MYGUIClass", "Input Files", 0, QApplication::UnicodeUTF8)); 
     label_5->setText(QApplication::translate("MYGUIClass", "Instrument File:", 0, QApplication::UnicodeUTF8)); 
     pushButtonSettingsInstFileBrowse->setText(QApplication::translate("MYGUIClass", "...", 0, QApplication::UnicodeUTF8)); 
     tabWidgetMYGUI->setTabText(tabWidgetMYGUI->indexOf(OptionsTab), QApplication::translate("MYGUIClass", "Settings", 0, QApplication::UnicodeUTF8)); 
     menuOptions->setTitle(QApplication::translate("MYGUIClass", "Options", 0, QApplication::UnicodeUTF8)); 
    } // retranslateUi 

}; 

namespace Ui { 
    class MYGUIClass: public Ui_MYGUIClass {}; 
} // namespace Ui 

QT_END_NAMESPACE 

#endif // UI_MYGUI_H 

이것은 문제없이 컴파일됩니다. 내가합니다 (aplication 검증을 사용하여) 응용 프로그램을 시작할 때 나는 ui_mygui.h에서

void setupUi(QMainWindow *MYGUIClass) 

이 완료되는 방법 후 트리거 브레이크 포인트를 얻을 MYengine의 생성자가 입력됩니다. 생성자의 어떤 라인도 실행되지 않고 단지 중단 점을 트리거합니다. 확인자 보고서입니다.

===================== VERIFIER STOP 00000013 : pid 0x1CDC : 현재 스택 추적에 대한 첫 번째 기회 액세스 위반입니다.

0AF79000 : Invalid address causing the exception. 
00E15057 : Code address executing the invalid access. 
0032F134 : Exception record. 
0032F184 : Context record. 

======================================= 이 검증 정지 계속할 수 있습니다. 디버깅 후 계속하려면 'go'를 사용하십시오.

=======================================

나는 단지의 경우 그래픽 사용자 인터페이스가 열립니다 mygui.cpp에 한 줄

myEngine_ = boost::shared_ptr<MYengine>(new MYengine()); 

을 삭제, 어떤 응용 프로그램 검증 중단 점은 모든 것이 잘 작동하는 것 같다.

나는 완전히 잃어 버렸습니다. 클래스 MYengine은 수백 개의 클래스가 추가 된 정적 라이브러리에 포함 된 대형 클래스입니다. Myengine 생성자의 첫 번째 행이 실행되기 전에도 오류가 발생합니다. 그렇다면 위의 행을 사용하거나 사용하지 않은 이유는 동작이 너무 다른 이유는 무엇입니까? 어떤 아이디어든지 높게 평가 될 것입니다. 이 코드가 나를 만들기 시작했다. - (

+0

왜 QSharedPointer가있을 때 boost :: shared_ptr을 사용합니까? – Archie

+0

어떤 최적화 수준을 사용하고 있습니까? MYEngine 생성자 내부의 메모리 손상으로 인해 setupUi에서 오류가 발생할 수있었습니다. – Ixanezis

+0

@Archie : QSharedPointer로 시도해 보았습니다. 변경 없음. 나는 Qt를 처음 사용하고 항상 이전에 공유 포인터를 사용했다. –

답변

0

코드의 나머지 부분을 모른 채 Qt 포인터를 부스트 공유 포인터에 넣으면 안된다. Qt는 자체 객체 수명주기 관리 기능을 가지고 있으며 삭제할 것이다. 당신이 출시 메모리 부스트 포인터를 가리키는으로 끝낼 수 있도록 공유 포인터를 묻지 않고 메모리. 그러나 이것은 단지 아마 각각 * QMenu를 * 및 QAction해야

boost::shared_ptr<QMenu> treeWidgetMenu_; 
boost::shared_ptr<QAction> treeWidgetMenuDeleteAction_; 

에 적용됩니다.

MYengine이 Qt 클래스가 아니라고 가정합니다.아마도 MyEngine에 대한 공유 포인터가 문제를 일으키는 이유를 이해할 수 있도록 MyEngine 인터페이스를 보여 주어야합니다.