I have filed a bug report.
[ Bug #12780 (http://developer.berlios.de/bugs/?func=detailbug&bug_id=12780&group_id=5358) ]
The problem is in the win32 gui project wizard script.
[CB path]\share\CodeBlocks\templates\wizard\win32gui\wizard.script [line 60-66]
function OnGetNextPage_CompilerPage()
{
if (GetCompilerFactory().CompilerInheritsFrom(Wizard.GetCompilerID(), _T("msvc*")))
return _T("PsdkPath");
else
return _T("");
}
All CompilerPanel's m_PageName is "CompilerPage".
/src/plugins/scriptedwizard/wizpage.cpp [line 447-449]
WizCompilerPanel::WizCompilerPanel(const wxString& compilerID, const wxString& validCompilerIDs, wxWizard* parent, const wxBitmap& bitmap,
bool allowCompilerChange, bool allowConfigChange)
: WizPageBase(_T("CompilerPage"), parent, bitmap),
So "OnGetNextPage_CompilerPage" is called.
/src/plugins/scriptedwizard/wizpage.cpp [line 93-111]
wxWizardPage* WizPageBase::GetNext() const
{
try
{
wxString sig = _T("OnGetNextPage_") + m_PageName;
SqPlus::SquirrelFunction<wxString&> cb(cbU2C(sig));
if (cb.func.IsNull())
return wxWizardPageSimple::GetNext();
wxString next = cb();
if (next.IsEmpty())
return 0;
return s_PagesByName[next];
}
catch (SquirrelError& e)
{
Manager::Get()->GetScriptingManager()->DisplayErrors(&e);
}
return wxWizardPageSimple::GetNext();
}
So if you has create a win32 gui project, all other project wizard will finish at CompilerPage.(because OnGetNextPage_CompilerPage() return _T("")?)
I don't know how to solve this bug.
Here is a quick and dirty patch that make wizard work again.
There is surely a better way to do it, but I could not investigate if it's possible to remove a compiled SquirrelFunction from memory.
So this is an easy way and should not be dangerous (as long as no compiler page is called "function_cleared" or whatever string is used as dummy).
Index: src/plugins/scriptedwizard/wiz.cpp
===================================================================
--- src/plugins/scriptedwizard/wiz.cpp (revision 4750)
+++ src/plugins/scriptedwizard/wiz.cpp (working copy)
@@ -214,7 +214,8 @@
"function SetupTarget(target,is_debug){return false;};\n"
"function SetupCustom(){return false;};\n"
"function CreateFiles(){return _T(\"\");};\n"
- "function GetFilesDir(){return _T(\"\");};\n"
+ "function GetFilesDir(){return _T(\"\");};\n"
+ "function OnGetNextPage_CompilerPage(){return _T(\"function_cleared\");};\n"
"function GetGeneratedFile(index){return _T(\"\");};\n");
Manager::Get()->GetScriptingManager()->LoadBuffer(clearout_wizscripts, _T("ClearWizState"));
Index: src/plugins/scriptedwizard/wizpage.cpp
===================================================================
--- src/plugins/scriptedwizard/wizpage.cpp (revision 4750)
+++ src/plugins/scriptedwizard/wizpage.cpp (working copy)
@@ -99,6 +99,8 @@
if (cb.func.IsNull())
return wxWizardPageSimple::GetNext();
wxString next = cb();
+ if (next == _T("function_cleared"))
+ return wxWizardPageSimple::GetNext();
if (next.IsEmpty())
return 0;
return s_PagesByName[next];
This is a quite serious bug. It not only affects Console wizard; it also affects other wizards (e.g., wxWidgets project wizard) which has one or more pages beyond the Compiler selection page.
Here is a quick and dirty patch that make wizard work again.
There is surely a better way to do it, but I could not investigate if it's possible to remove a compiled SquirrelFunction from memory.
So this is an easy way and should not be dangerous (as long as no compiler page is called "function_cleared" or whatever string is used as dummy).
The quick patch is ok. But it doesn't fix the issue completely. This issue may resurface with other wizards. :)
@Yiannis,
Is it possible to delete the Squirrel compiled function from the memory after it has been executed? I tried to remove it in the following way. But it didn't work. :(
Index: src/plugins/scriptedwizard/wizpage.cpp
===================================================================
--- src/plugins/scriptedwizard/wizpage.cpp (revision 4750)
+++ src/plugins/scriptedwizard/wizpage.cpp (working copy)
@@ -98,7 +98,8 @@
SqPlus::SquirrelFunction<wxString&> cb(cbU2C(sig));
if (cb.func.IsNull())
return wxWizardPageSimple::GetNext();
- wxString next = cb();
+ wxString next = cb();
+ cb.reset();
if (next.IsEmpty())
return 0;
return s_PagesByName[next];
Best regards,
Biplab