Bennett Helm wrote:
> On Nov 16, 2006, at 6:41 AM, Peter Kümmel wrote:
> 
>> Bennett Helm wrote:
>>> 1.5.0 alpha crashes every time on quit on Intel Mac. Here's the
>>> backtrace:
>>>
>>> Program received signal SIGABRT, Aborted.
>>> 0x9003d1dc in kill ()
>>> (gdb) bt
>>> #0  0x9003d1dc in kill ()
>>> #1  0x9010f2af in raise ()
>>> #2  0x9010de02 in abort ()
>>> #3  0x90b4039c in __gnu_cxx::__verbose_terminate_handler ()
>>> #4  0x90b3e602 in __gxx_personality_v0 ()
>>> #5  0x90b3e640 in std::terminate ()
>>> #6  0x90b3ea93 in __cxa_pure_virtual ()
>>
>> Maybe it is a variation of this problem:
>>
>> "You probably already know that this error is caused by calling pure
>> virtual methods from the constructor or destructor of the base class.
>> It must be an indirect call, because GCC will issue an error about
>> direct calls. "
>>
>> So, does the attached patch help?
> 
> No: it won't compile!

Sorry, the patch was not complete, here a new one
and one with the missing part.

Peter
Index: src/frontends/Application.C
===================================================================
--- src/frontends/Application.C (revision 15949)
+++ src/frontends/Application.C (working copy)
@@ -92,7 +92,12 @@
        return exec();
 }
 
+void Application::unregisterSocketCallback(int fd)
+{
+       unregisterSocketCallback_impl(fd);
+}
 
+
 } // namespace frontend
 
 
Index: src/frontends/Application.h
===================================================================
--- src/frontends/Application.h (revision 15949)
+++ src/frontends/Application.h (working copy)
@@ -108,7 +108,7 @@
        * remove a I/O read callback
        * @param fd socket descriptor (file/socket/etc)
        */
-       virtual void unregisterSocketCallback(int fd) = 0;
+       void unregisterSocketCallback(int fd);
 
        /// Create the main window with given geometry settings.
        LyXView & createView(unsigned int width, unsigned int height,
@@ -128,6 +128,10 @@
        /// Events
        LyXView * current_view_;
 
+       // don't call pure virtual functions in the ctor/dtor directly
+       // MAC GCC doesn't like it
+       virtual void unregisterSocketCallback_impl(int fd) = 0;
+
 }; // Application
 
 } // namespace frontend
Index: src/frontends/qt4/GuiApplication.C
===================================================================
--- src/frontends/qt4/GuiApplication.C  (revision 15949)
+++ src/frontends/qt4/GuiApplication.C  (working copy)
@@ -274,7 +274,7 @@
 }
 
 
-void GuiApplication::unregisterSocketCallback(int fd)
+void GuiApplication::unregisterSocketCallback_impl(int fd)
 {
        socket_callbacks_.erase(fd);
 }
Index: src/frontends/qt4/GuiApplication.h
===================================================================
--- src/frontends/qt4/GuiApplication.h  (revision 15949)
+++ src/frontends/qt4/GuiApplication.h  (working copy)
@@ -74,7 +74,7 @@
        virtual void updateColor(LColor_color col);
        virtual void registerSocketCallback(
                int fd, boost::function<void()> func);
-       virtual void unregisterSocketCallback(int fd);
+       virtual void unregisterSocketCallback_impl(int fd);
        //@}
 
        ///
Index: src/frontends/Application.C
===================================================================
--- src/frontends/Application.C (revision 15949)
+++ src/frontends/Application.C (working copy)
@@ -92,7 +92,12 @@
        return exec();
 }
 
+void Application::unregisterSocketCallback(int fd)
+{
+       unregisterSocketCallback_impl(fd);
+}
 
+
 } // namespace frontend
 
 

Reply via email to