Nux

Merge lp:~gordallott/nux/nux-fix-sigsevs into lp:nux

Proposed by Gord Allott
Status: Merged
Approved by: Neil J. Patel
Approved revision: 290
Merged at revision: 294
Proposed branch: lp:~gordallott/nux/nux-fix-sigsevs
Merge into: lp:nux
Diff against target: 63 lines (+27/-0)
3 files modified
Nux/WindowThread.cpp (+18/-0)
Nux/WindowThread.h (+2/-0)
NuxImage/CairoGraphics.cpp (+7/-0)
To merge this branch: bzr merge lp:~gordallott/nux/nux-fix-sigsevs
Reviewer Review Type Date Requested Status
Neil J. Patel Pending
Review via email: mp+54577@code.launchpad.net

Description of the change

Just fixes a few crashers in nux

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Nux/WindowThread.cpp'
--- Nux/WindowThread.cpp 2011-03-20 04:03:32 +0000
+++ Nux/WindowThread.cpp 2011-03-23 18:16:46 +0000
@@ -461,9 +461,27 @@
461 return; 461 return;
462 462
463 if (_focused_area != NULL)463 if (_focused_area != NULL)
464 {
464 _focused_area->SetFocused (false);465 _focused_area->SetFocused (false);
466
467 if (_focused_area_destroyed_con.empty () == false)
468 {
469 _focused_area_destroyed_con.disconnect ();
470 }
471
472 }
465 473
466 _focused_area = focused_area;474 _focused_area = focused_area;
475 _focused_area_destroyed_con = focused_area->OnDestroyed.connect (sigc::mem_fun (this, &WindowThread::OnFocusedAreaDestroyed));
476
477 }
478
479 void WindowThread::OnFocusedAreaDestroyed (Object *object)
480 {
481 if (object == _focused_area)
482 {
483 _focused_area = NULL;
484 }
467 }485 }
468486
469 void WindowThread::AsyncWakeUpCallback (void* data)487 void WindowThread::AsyncWakeUpCallback (void* data)
470488
=== modified file 'Nux/WindowThread.h'
--- Nux/WindowThread.h 2011-03-17 14:47:06 +0000
+++ Nux/WindowThread.h 2011-03-23 18:16:46 +0000
@@ -469,7 +469,9 @@
469 std::list< ThreadInfo * > m_ChildThreadInfo;469 std::list< ThreadInfo * > m_ChildThreadInfo;
470470
471 private:471 private:
472 void OnFocusedAreaDestroyed (Object *object);
472 Area *_focused_area;473 Area *_focused_area;
474 sigc::connection _focused_area_destroyed_con;
473 //! Informs the system of the start of a layout cycle.475 //! Informs the system of the start of a layout cycle.
474 /*!476 /*!
475 This call merely sets a flag to true or false. This flag is used to decided if some actions should be 477 This call merely sets a flag to true or false. This flag is used to decided if some actions should be
476478
=== modified file 'NuxImage/CairoGraphics.cpp'
--- NuxImage/CairoGraphics.cpp 2011-03-22 10:11:36 +0000
+++ NuxImage/CairoGraphics.cpp 2011-03-23 18:16:46 +0000
@@ -123,6 +123,13 @@
123 t_u8 *ptr = cairo_image_surface_get_data (_cairo_surface);123 t_u8 *ptr = cairo_image_surface_get_data (_cairo_surface);
124 int stride = cairo_image_surface_get_stride (_cairo_surface);124 int stride = cairo_image_surface_get_stride (_cairo_surface);
125125
126 if (ptr == NULL || stride == 0)
127 {
128 // _cairo_surface is not a valid surface
129 nuxError (TEXT ("[CairoGraphics::GetBitmap] Invalid surface"));
130 return bitmap_data; // just returns because we will segfault otherwise
131 }
132
126 if (m_surface_format == CAIRO_FORMAT_A1)133 if (m_surface_format == CAIRO_FORMAT_A1)
127 {134 {
128 t_u8 *temp = new t_u8[bitmap_data->GetSurface (0).GetPitch() ];135 t_u8 *temp = new t_u8[bitmap_data->GetSurface (0).GetPitch() ];

Subscribers

People subscribed via source and target branches