Opened 16 years ago
Closed 16 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)
Changed 16 years ago by
Attachment: | mythcontext.patch added |
---|
comment:1 Changed 16 years ago by
comment:2 Changed 16 years ago by
Milestone: | 0.21 → unknown |
---|---|
Owner: | changed from Isaac Richards to Nigel |
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 Changed 16 years ago by
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.