Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Crash when clean a single file

(1/4) > >>

lfm:
I'm using C::B 1.0 rev 2490.
When i open a .cpp single file (the file not inside project, no project), then click menu "Build->Clean", C::B crash.
I'm sorry, I using chinese WinXP-sp2. So, you maybe don't understand means of the error message picture.


[attachment deleted by admin]

David Perfors:
lucky for us, the rpt file is better readable ;)

MortenMacFly:
The same thing happens if you try a rebuild with a single file (it's the same code).
The issue is in the method int CompilerGCC::Clean(ProjectBuildTarget* target) (for the clean case). At:

--- Code: ---    if (m_Project)
        wxSetWorkingDirectory(m_Project->GetBasePath());
    CompilerFactory::GetCompiler(m_CompilerId)->Init(m_Project);

--- End code ---
The CompilerFactory::GetCompiler(m_CompilerId)->Init(m_Project); fails because m_CompilerId is "" (an empty string) which will cause GetCompiler(m_CompilerId) to return 0 (NULL)... It's the same for the rebuild command... I'm doing further research tomorrow becasue I'm far too tired for now...
With regards, Morten.

MortenMacFly:
...just a short addition before I go to bed: Maybe Compiler* CompilerFactory::GetCompiler(const wxString& id) should return the default compiler instead of 0 if it is passed an empty string? This would be more save... or not?!
With regards, Morten.

killerbot:
in this case there's no compiler either from the
  - project
  - target
it seems we need to add an if test here, which should test for "no project/no target", it this test holds true it should either :
  - use CompilerFactory::GetDefaultCompiler()
  - or specify as compiler id :: CompilerFactory::GetDefaultCompilerID()

In case nobody has time to test this 'possible solution' I will try it out myself tomorrow.


(damn : CB crashed on me again, 'quick opening of workspace/project or whatsoever ... :-(  )


[EDIT] : Morton posted at the same time ;-) well the idea is not bad, but I think in this case it's good to stress that we explicitly want the default compiler, and it didn't gives us the default compiler because off a fallback protection safety net

PS : about the crash : again I have an empty rpt ....

Navigation

[0] Message Index

[#] Next page

Go to full version