RE: Glib::signal_timeout().connect_seconds
- From: Mark Roberts <gtkmm manumark de>
- To: sledge hammer <sledgehammer_999 hotmail com>
- Cc: gtkmm-list gnome org
- Subject: RE: Glib::signal_timeout().connect_seconds
- Date: Sat, 17 Oct 2009 23:08:19 +0200 (CEST)
Mik wrote:
> bool MainWindow::onTimeout30s(int timerNumber)
> {
> clog << "MainWindow::onTimeout30s" << std::endl;
>
> clog << "mTimeoutConnection::empty " <<
> (mTimeoutConnection.empty()?"true":"false") << endl;
> clog << "mTimeoutConnection::connected " <<
> (mTimeoutConnection.connected()?"true":"false") << endl;
> }
Sledge Hammer wrote:
I am surprised that g++ doesn't give you a warning while compiling that
piece of code. In "MainWindow::onTimeout30s()" you have forgotten to
return a value. Put "return true;" If you want MainWindow::onTimeout30s()
to be called again or "return false" to disconnect the signal handler.
In other words: you should use -Wall when compiling with g++. You can
catch a lot of silly typos early in the production cycle.
More generally spoken: write code that, if incorrect, will produce
compiler warnings or errors, instead of code that, if incorrect, will fail
while your customer is running the program.
Mark
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]