Nux

Merge lp:~loic.molinari/nux/nux-clean-up-at-destruction-2 into lp:nux

Proposed by Loïc Molinari
Status: Merged
Merged at revision: 329
Proposed branch: lp:~loic.molinari/nux/nux-clean-up-at-destruction-2
Merge into: lp:nux
Diff against target: 86 lines (+16/-7)
3 files modified
NuxCore/ThreadGNU.h (+6/-2)
NuxGraphics/GraphicsDisplayX11.cpp (+6/-3)
NuxGraphics/GraphicsDisplayX11.h (+4/-2)
To merge this branch: bzr merge lp:~loic.molinari/nux/nux-clean-up-at-destruction-2
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Review via email: mp+57700@code.launchpad.net

Description of the change

That branch fixes some crashes at destruction.

To post a comment you must log in.
331. By Loïc Molinari

Fixed ABI break

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Approved, looks good and doesn't break the ABI :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NuxCore/ThreadGNU.h'
2--- NuxCore/ThreadGNU.h 2011-04-06 21:54:09 +0000
3+++ NuxCore/ThreadGNU.h 2011-04-14 15:38:09 +0000
4@@ -426,9 +426,13 @@
5 class NThreadContext
6 {
7 public:
8- NThreadContext()
9+ NThreadContext ()
10+ : m_pUserData (NULL)
11+ , m_pParent (NULL)
12+ , m_dwExitCode (0)
13 {
14- //memset(this, 0, sizeof(this));
15+ memset (&m_ThreadAttribute, 0, sizeof (m_ThreadAttribute));
16+ memset (&m_dwTID, 0, sizeof (m_dwTID));
17 }
18
19 /*
20
21=== modified file 'NuxGraphics/GraphicsDisplayX11.cpp'
22--- NuxGraphics/GraphicsDisplayX11.cpp 2011-04-08 23:11:56 +0000
23+++ NuxGraphics/GraphicsDisplayX11.cpp 2011-04-14 15:38:09 +0000
24@@ -63,6 +63,7 @@
25
26 GraphicsDisplay::GraphicsDisplay()
27 {
28+ m_CreatedFromForeignWindow = false;
29 m_ParentWindow = 0;
30 m_GLCtx = 0;
31 m_Fullscreen = false;
32@@ -87,8 +88,6 @@
33 m_WindowSize.SetWidth (0);
34 m_WindowSize.SetHeight (0);
35
36- // A window never starts in a minimized state.
37- m_is_window_minimized = false;
38 _has_glx_13 = false;
39 _glx_major = 0;
40 _glx_minor = 0;
41@@ -114,7 +113,9 @@
42 NUX_SAFE_DELETE ( m_GraphicsContext );
43 NUX_SAFE_DELETE ( m_DeviceFactory );
44
45- DestroyOpenGLWindow();
46+ if (m_CreatedFromForeignWindow == false)
47+ DestroyOpenGLWindow ();
48+
49 NUX_SAFE_DELETE ( m_pEvent );
50
51 inlSetThreadLocalStorage (_TLS_GraphicsDisplay, 0);
52@@ -554,6 +555,8 @@
53
54 InitGlobalGrabWindow ();
55
56+ m_CreatedFromForeignWindow = true;
57+
58 return true;
59 }
60
61
62=== modified file 'NuxGraphics/GraphicsDisplayX11.h'
63--- NuxGraphics/GraphicsDisplayX11.h 2011-04-06 21:54:09 +0000
64+++ NuxGraphics/GraphicsDisplayX11.h 2011-04-14 15:38:09 +0000
65@@ -128,7 +128,7 @@
66 void GetDisplayInfo();
67 int m_BestMode;
68
69- bool m_is_window_minimized;
70+ bool m_CreatedFromForeignWindow;
71
72 public:
73 typedef void (*GrabReleaseCallback) (bool replaced, void *user_data);
74@@ -217,9 +217,11 @@
75
76 IEvent &GetCurrentEvent();
77
78+ // That method is deprecated, it always returns false and still here in
79+ // order to maintain API compatibility.
80 bool isWindowMinimized() const
81 {
82- return m_is_window_minimized;
83+ return false;
84 }
85
86 void ShowWindow();

Subscribers

People subscribed via source and target branches