colicrod / openholdembot

Automatically exported from code.google.com/p/openholdembot
Other
0 stars 0 forks source link

OpenScrape, if built in debug mode, crashes when saving a file #26

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
> Which product and version is being used?
 OpenScrape from SVN, r823

> What steps will reproduce the problem?
1. Build OpenScrape in debug mode from the SVN
2. Start OpenScrape, click "save", click 'ok'
3. The 'ASSERT_VALID(m_pFile)' fails in arccore.cpp:346 (in CArchive::Close
())

> What is the expected output? What do you see instead?

The file appears to be correctly saved, but the app crashes.

This also happens if you open an existing map & save it.

> Please provide any additional information below.

I'm not that familiar with MFC, but the CDocument::OnSaveDocument function 
(doccore.cpp:682) does the following:

>  Serialize(saveArchive);     // save me
>  saveArchive.Close();
>  ReleaseFile(pFile, FALSE);

... but the CTablemap implementation of Serialize() also does a Close() 
(CTablemap.cpp:726).

I think that the correct solution is to not close the file inside Serialize
(), since the MFC framework will close it for us.

Patch attached.

Other changes in this patch:
 - I got a "variable being used without being assigned" error in 
CMainFrame::OnUpdateEditDuplicateregion -- I've initialised it to NULL.

Possible workarounds: don't use debug builds ;-)

Original issue reported on code.google.com by fishyph...@googlemail.com on 8 Jun 2009 at 6:30

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by thehighfish@googlemail.com on 11 Jun 2009 at 8:02

GoogleCodeExporter commented 8 years ago
Verified, patch reviewed and applied.

Original comment by thehighfish@googlemail.com on 11 Jun 2009 at 8:29