Opened 18 years ago
Closed 17 years ago
#4546 closed patch (worksforme)
Avoid exporting global variables (functions only)
| Reported by: | 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)
Change History (4)
by , 18 years ago
| Attachment: | mythcontext.patch added |
|---|
comment:1 by , 18 years ago
comment:2 by , 18 years ago
| Milestone: | 0.21 → unknown |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
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 by , 17 years ago
| Resolution: | → worksforme |
|---|---|
| Status: | assigned → closed |
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.

+1 opinion, if it helps at all.