Skip to content

Commit 64caf11

Browse files
committed
bug fix: crash if expand watch item when debugger is not active
1 parent 1fd038f commit 64caf11

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

PythonDebugger/PyDebugger.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -829,15 +829,21 @@ bool PyDebugger::SetWatchValue(cb::shared_ptr<cbWatch> watch, const wxString &va
829829

830830
void PyDebugger::ExpandWatch(cb::shared_ptr<cbWatch> watch)
831831
{
832-
wxString symbol;
833-
watch->GetSymbol(symbol);
834-
DispatchCommands(_T("pm ")+symbol+_T("\n"),DBGCMDTYPE_WATCHGETCHILDREN);
832+
if(IsRunning())
833+
{
834+
wxString symbol;
835+
watch->GetSymbol(symbol);
836+
DispatchCommands(_T("pm ")+symbol+_T("\n"),DBGCMDTYPE_WATCHGETCHILDREN);
837+
}
835838
}
836839

837840
void PyDebugger::CollapseWatch(cb::shared_ptr<cbWatch> watch)
838-
{
839-
watch->RemoveChildren();
840-
cbWatch::AddChild(watch,PythonWatch::Pointer(new PythonWatch(_("...members..."))));
841+
{
842+
if(IsRunning())
843+
{
844+
watch->RemoveChildren();
845+
cbWatch::AddChild(watch,PythonWatch::Pointer(new PythonWatch(_("...members..."))));
846+
}
841847
}
842848

843849
void PyDebugger::OnWatchesContextMenu(wxMenu &menu, const cbWatch &watch, wxObject *property)

0 commit comments

Comments
 (0)