Opened 12 years ago

Closed 11 years ago

#4546 closed patch (worksforme)

Avoid exporting global variables (functions only)

Reported by: andrei@… Owned by: Nigel
Priority: minor Milestone: unknown
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Win32 (sorry, again) doesn't like exported global variables and segfaults when accessing gContext and g_SSDP. The attached patch is very raw, I'm not suggesting to commit it as is, I'm just asking for opinion. If this will be considered a good idea, I'll hunt down other globals as well and submit another patch.

For better effect, CreateMythContext? (introduced in this patch) can be combined with mandatory gContext->Init.

Attachments (1)

mythcontext.patch (6.4 KB) - added by andrei@… 12 years ago.

Download all attachments as: .zip

Change History (4)

Changed 12 years ago by andrei@…

Attachment: mythcontext.patch added

comment:1 Changed 12 years ago by David Bussenschutt <davidbuzz@…>

+1 opinion, if it helps at all.

comment:2 Changed 12 years ago by danielk

Milestone: 0.21unknown
Owner: changed from Isaac Richards to Nigel
Status: newassigned

Nigel has been looking at these types of issues, so I'm assigning this to him. But there must be a way to allow globals in these DLL's. I personally don't think a global function is any better than a global variable, coding style wise.

comment:3 Changed 11 years ago by Nigel

Resolution: worksforme
Status: assignedclosed

After Isaac eliminated the circular library dependencies, this segfaulting stopped, so it was probably a side-effect of the library symbol .def files (which I guess should be removed). Anyway, this can be closed.

Note: See TracTickets for help on using tickets.