tobiasdeiminger added a comment.

  > One thing that may fix it is changing
  > 
  >   m_sidebar = new Sidebar( parentWidget );
  > 
  > to
  > 
  >   m_sidebar = new Sidebar();
  > 
  > in part.cpp, this micht change the part/child relationships and get 
yourself of this problem. can you give it a quick try?
  
  Seems like sidebar becomes a (grand-)child of Shells QTabWidget, no matter 
what you set as parent widget in Sidebar Ctor. This is because of ##setWidget( 
m_sidebar )## in Part::Part(), and  ##m_tabWidget->addTab( firstPart->widget(), 
QString() )## in Shell::Shell(). Then C++ Dtor order lets Shell::~Shell (cleans 
up child widgets, including sidebar) be called earlier than Part::~Part.
  
  > Should we stick to it or should we consider saving the stats in the 
Sidebar::~Sidebar()?
  
  Would it be an option to save sidebar state in ##Part::closeUrl()##?
  It is called early enough by Shell Dtor. For me it fixes the segfault, and 
"closeUrl" sounds like a reasonable action to cause document related state 
saving.

REPOSITORY
  R223 Okular

REVISION DETAIL
  https://phabricator.kde.org/D11051

To: dileepsankhla, #okular, aacid
Cc: tobiasdeiminger, aacid, sander, #okular, michaelweghorn, ngraham

Reply via email to