assert "IsOpened()" failed in GetFirst() when running in debug mode

Bug #1434932 reported by Sean Greenslade
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Hugin
Fix Released
Undecided
Unassigned

Bug Description

When compiling in debug mode and running from the build directory, an assertion is triggered due to the missing plugins directory.

ASSERT INFO:
./src/unix/dir.cpp(275): assert "IsOpened()" failed in GetFirst(): must wxDir::Open() first

BACKTRACE:
[1] wxDir::GetFirst(wxString*, wxString const&, int) const
[2] MainFrame::MainFrame(wxWindow*, HuginBase::Panorama&) /home/sean/pkg/hugin-hg/src/hugin/src/hugin1/hugin/MainFrame.cpp:371
[3] huginApp::OnInit() /home/sean/pkg/hugin-hg/src/hugin/src/hugin1/hugin/huginApp.cpp:315
[4] wxAppConsoleBase::CallOnInit() /usr/include/wx-3.0/wx/app.h:93
[5] wxEntry(int&, wchar_t**)
[6] main /home/sean/pkg/hugin-hg/src/hugin/src/hugin1/hugin/huginApp.cpp:118
[7] __libc_start_main
[8] _start

The attached patch fixes the issue by checking whether the dir open succeeded before attempting to access it. (I used hg diff this time, let me know if it's formatted right.)

Revision history for this message
Sean Greenslade (o-sean) wrote :
Revision history for this message
tmodes (tmodes) wrote :

Thanks. Committed a slightly modified version.

We are using spaces for indentation, no tabs. (There are some place where tabs are still used. But I try to keep at spaces.)

Changed in hugin:
status: New → Fix Committed
tmodes (tmodes)
Changed in hugin:
milestone: none → 2015.0beta1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.