Commit 34f53342 authored by Matt Edman's avatar Matt Edman
Browse files

Clear the mapping of keyid-to-RouterListItem when we clear our

RouterListWidget. Previously, if the list was cleared between a geoip resolve
request and response, we would look up a pointer to a RouterListItem that no
longer existed and crash on arma. :(


svn:r1241
parent 6775b36b
Loading
Loading
Loading
Loading
+6 −1
Changes for src/gui/network/netviewer.cpp: 6 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -178,9 +178,14 @@ NetViewer::refresh()
void
NetViewer::clear()
{
  /* Clear the resolve queue and map */
  _resolveMap.clear();
  _resolveQueue.clear();
  /* Clear the network map */
  _map->clear();
  _map->update();
  ui.treeRouterList->clear();
  /* Clear the lists of routers, circuits, and streams */
  ui.treeRouterList->clearRouters();
  ui.treeCircuitList->clear();
  ui.textRouterInfo->clear();
}
+8 −0
Changes for src/gui/network/routerlistwidget.cpp: 8 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -58,6 +58,14 @@ RouterListWidget::deselectAll()
  }
}

/** Clear the list of router items. */
void
RouterListWidget::clearRouters()
{
  _idmap.clear();
  QTreeWidget::clear();
}

/** Inserts a new router list item into the list, in its proper sorted place
 * according to the current sort column. */
void
+4 −0
Changes for src/gui/network/routerlistwidget.h: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -72,6 +72,10 @@ signals:
  /** Called when the user selects a router from the list. */
  void routerSelected(RouterDescriptor rd);

public slots:
  /** Clears the list of router items. */
  void clearRouters();
  
private slots:
  /** Called when the user clicks on an item in the list. */
  void onSelectionChanged();