When I create a console project, the dialog "Please set the language you want to use" disappeared in the last nightly builds(rev 4749).
Now I can only create a c++ project.
How to create a c project?
rev 4592 is OK.
Thanks.
It works as intended. Please check again. :)
Quote from: Biplab on December 24, 2007, 09:55:57 AM
It works as intended. Please check again. :)
After checking again, I found that rev4592 had the same wrong behaviour.
It can be reproduced by:
1. create a "Win32 GUI project" project
2. create a "Console application" project
In step 2 the dialog to select language disappeared.
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.
Quote from: clyfish on December 24, 2007, 03:23:34 PM
I have filed a bug report.
[ Bug #12780 (http://developer.berlios.de/bugs/?func=detailbug&bug_id=12780&group_id=5358) ]
....
I don't know how to solve this bug.
I can confirm this bug. Thanks for the investigation and the bug report. I'll look into it. :)
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.
Quote from: jens on December 25, 2007, 12:47:10 AM
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
Another question I have:
To clear the functions of a formerly run wizardscript, new functions with the same name, but default return-values are compiled.
What happens to the "old" function-pointers and the content of the functions, are they still on the stack (and somewhere in the memory) or are they removed by the SquirrelVM .
If they reside in memory this might be potential dangerous.