Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
b427aa49
Commit
b427aa49
authored
Apr 24, 2014
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
single_top w/o kiface whines and exits gracefully.
parent
1e68c5f8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
12 deletions
+58
-12
basicframe.cpp
common/basicframe.cpp
+5
-2
single_top.cpp
common/single_top.cpp
+53
-10
No files found.
common/basicframe.cpp
View file @
b427aa49
...
...
@@ -107,7 +107,10 @@ EDA_BASE_FRAME::EDA_BASE_FRAME( wxWindow* aParent, FRAME_T aFrameType,
void
EDA_BASE_FRAME
::
windowClosing
(
wxCloseEvent
&
event
)
{
SaveSettings
(
config
()
);
// virtual, wxFrame specific
wxConfigBase
*
cfg
=
config
();
if
(
cfg
)
SaveSettings
(
cfg
);
// virtual, wxFrame specific
event
.
Skip
();
// we did not "handle" the event, only eavesdropped on it.
}
...
...
@@ -266,7 +269,7 @@ wxConfigBase* EDA_BASE_FRAME::config()
{
// KICAD_MANAGER_FRAME overrides this
wxConfigBase
*
ret
=
Kiface
().
KifaceSettings
();
wxASSERT
(
ret
);
//
wxASSERT( ret );
return
ret
;
}
...
...
common/single_top.cpp
View file @
b427aa49
...
...
@@ -152,21 +152,43 @@ PGM_BASE& Pgm()
struct
APP_SINGLE_TOP
:
public
wxApp
{
bool
OnInit
()
// overload wxApp virtual
{
try
{
return
Pgm
().
OnPgmInit
(
this
);
}
catch
(
const
std
::
exception
&
e
)
{
wxLogError
(
wxT
(
"Unhandled exception class: %s what: %s"
),
GetChars
(
FROM_UTF8
(
typeid
(
e
).
name
()
)),
GetChars
(
FROM_UTF8
(
e
.
what
()
)
)
);;
}
catch
(
const
IO_ERROR
&
ioe
)
{
wxLogError
(
GetChars
(
ioe
.
errorText
)
);
}
catch
(...)
{
wxLogError
(
wxT
(
"Unhandled exception of unknown type"
)
);
}
Pgm
().
OnPgmExit
();
return
false
;
}
int
OnExit
()
// overload wxApp virtual
{
Pgm
().
OnPgmExit
();
return
wxApp
::
OnExit
();
}
int
OnRun
()
// overload wxApp virtual
{
int
ret
=
-
1
;
try
{
ret
urn
wxApp
::
OnRun
();
ret
=
wxApp
::
OnRun
();
}
catch
(
const
std
::
exception
&
e
)
{
...
...
@@ -183,7 +205,9 @@ struct APP_SINGLE_TOP : public wxApp
wxLogError
(
wxT
(
"Unhandled exception of unknown type"
)
);
}
return
-
1
;
Pgm
().
OnPgmExit
();
return
ret
;
}
/**
...
...
@@ -240,10 +264,30 @@ static KIFACE_GETTER_FUNC* get_kiface_getter( const wxString& aDSOName )
// No further reporting required here.
}
else
{
// Tell dso's wxDynamicLibrary destructor not to Unload() the program image.
(
void
)
dso
.
Detach
();
return
(
KIFACE_GETTER_FUNC
*
)
addr
;
}
// There is a file installation bug. We only look for KIFACE_I's which we know
// to exist, and we did not find one. If we do not find one, this is an
// installation bug.
wxString
msg
=
wxString
::
Format
(
wxT
(
"Fatal Installation Bug
\n
missing file:
\n
'%s'
\n\n
argv[0]:
\n
'%s'"
),
GetChars
(
aDSOName
),
GetChars
(
wxStandardPaths
::
Get
().
GetExecutablePath
()
)
);
// This is a fatal error, one from which we cannot recover, nor do we want
// to protect against in client code which would require numerous noisy
// tests in numerous places. So we inform the user that the installation
// is bad. This exception will likely not get caught until way up in the
// wxApp derivative, at which point the process will exit gracefully.
THROW_IO_ERROR
(
msg
);
#else
return
&
KIFACE_GETTER
;
...
...
@@ -415,9 +459,8 @@ void PGM_SINGLE_TOP::OnPgmExit()
saveCommonSettings
();
// write common settings to disk, and destroy everything in PGM_BASE,
// especially wxSingleInstanceCheckerImpl earlier than wxApp and earlier
// than static destruction would.
// Destroy everything in PGM_BASE, especially wxSingleInstanceCheckerImpl
// earlier than wxApp and earlier than static destruction would.
PGM_BASE
::
destroy
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment