Commit 78782dc
committed
Fix static initialization order for UserFormatRegister map
A std::map is in an invalid state when just zero-initialized, and needs
to be initialized by its constructor. As this initilization may be done
after the first call to Register, a crash will typically happen.
To fix this wrap all accesses to the map with a Meyers Singleton. Also
remove the extra Array - most accesses are using the key, and the few
format list iterations all sort the result afterwards anyway.
Fixes NGSolve#201.1 parent 975414c commit 78782dc
File tree
3 files changed
+36
-24
lines changed- libsrc
- interface
- meshing
3 files changed
+36
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
20 | 24 | | |
21 | | - | |
22 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
23 | 42 | | |
24 | 43 | | |
25 | 44 | | |
26 | 45 | | |
27 | 46 | | |
28 | | - | |
| 47 | + | |
29 | 48 | | |
30 | | - | |
31 | | - | |
| 49 | + | |
| 50 | + | |
32 | 51 | | |
33 | 52 | | |
34 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
| 31 | + | |
33 | 32 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 33 | + | |
| 34 | + | |
45 | 35 | | |
46 | 36 | | |
47 | 37 | | |
48 | 38 | | |
49 | | - | |
50 | | - | |
51 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
52 | 42 | | |
53 | 43 | | |
54 | | - | |
| 44 | + | |
55 | 45 | | |
56 | 46 | | |
| 47 | + | |
57 | 48 | | |
58 | 49 | | |
59 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
700 | 700 | | |
701 | 701 | | |
702 | 702 | | |
703 | | - | |
| 703 | + | |
| 704 | + | |
704 | 705 | | |
705 | 706 | | |
706 | 707 | | |
707 | 708 | | |
708 | 709 | | |
709 | 710 | | |
710 | 711 | | |
| 712 | + | |
711 | 713 | | |
712 | 714 | | |
713 | 715 | | |
| |||
0 commit comments