Visual studio 2010 在C+中调用lambda时发生访问冲突+;0x?

Visual studio 2010 在C+中调用lambda时发生访问冲突+;0x?,visual-studio-2010,lambda,c++11,Visual Studio 2010,Lambda,C++11,调用回调时,我收到访问冲突错误: typedef std::function<void(INT_PTR)> DIALOG_CALLBACK; //Declaration string userId=getUserId(); DIALOG_CALLBACK callTest=[userID, this] (INT_PTR) -> void{};//Does nothing yet CustomDialog dlg=new CustomDialog("Are you sure yo

调用回调时,我收到访问冲突错误:

typedef std::function<void(INT_PTR)> DIALOG_CALLBACK;
//Declaration
string userId=getUserId();
DIALOG_CALLBACK callTest=[userID, this] (INT_PTR) -> void{};//Does nothing yet
CustomDialog dlg=new CustomDialog("Are you sure you wish to run this operation", callTest);
....
//Definition
class CustomDialog: DialogBase{
public:
    DIALOG_CALLBACK callback;
    ....
}
//Call
void CustomDialog::OnOK(){
    callback(1);//Error occurs within call
}
链接:


似乎我在某个时候删除了this指针,这就是问题的原因

_Ret operator()(_ARG0_A0) const
{   // call through stored object
    if (_Impl == 0)
        _Xfunc();
        return (_Impl->_Do_call(_A0_A1));//Crashes on this line
}