View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0035304 | FPC | RTL | public | 2019-04-01 16:32 | 2019-04-01 19:31 |
Reporter | Ondrej Pokorny | Assigned To | Michael Van Canneyt | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 3.3.1 | Product Build | |||
Target Version | 3.2.0 | Fixed in Version | 3.3.1 | ||
Summary | 0035304: RegisterClassAlias is not thread-safe | ||||
Description | RegisterClassAlias is not thread-safe, as RegisterClasses and GetClass is. RegisterClassAlias must use the same lock as GetClass uses (ClassList.LockList). | ||||
Additional Information | Patch attached. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | 41818 | ||||
FPCOldBugId | |||||
FPCTarget | |||||
Attached Files |
|
|
RegisterClassAlias-01.patch (610 bytes)
Index: rtl/objpas/classes/cregist.inc =================================================================== --- rtl/objpas/classes/cregist.inc (revision 41802) +++ rtl/objpas/classes/cregist.inc (working copy) @@ -44,9 +44,14 @@ var I : integer; begin - i := ClassAliasList.IndexOf(Alias); - if I = -1 then - ClassAliasList.AddObject( Alias, TObject(AClass) ); + ClassList.LockList; + try + i := ClassAliasList.IndexOf(Alias); + if I = -1 then + ClassAliasList.AddObject( Alias, TObject(AClass) ); + finally + ClassList.UnlockList; + end; end; |
|
Thanks for the patch. Checked and applied ! |
|
Thank you! |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-04-01 16:32 | Ondrej Pokorny | New Issue | |
2019-04-01 16:32 | Ondrej Pokorny | File Added: RegisterClassAlias-01.patch | |
2019-04-01 17:00 | Michael Van Canneyt | Assigned To | => Michael Van Canneyt |
2019-04-01 17:00 | Michael Van Canneyt | Status | new => assigned |
2019-04-01 19:25 | Michael Van Canneyt | Fixed in Revision | => 41818 |
2019-04-01 19:25 | Michael Van Canneyt | Note Added: 0115170 | |
2019-04-01 19:25 | Michael Van Canneyt | Status | assigned => resolved |
2019-04-01 19:25 | Michael Van Canneyt | Fixed in Version | => 3.3.1 |
2019-04-01 19:25 | Michael Van Canneyt | Resolution | open => fixed |
2019-04-01 19:25 | Michael Van Canneyt | Target Version | => 3.2.0 |
2019-04-01 19:31 | Ondrej Pokorny | Note Added: 0115171 | |
2019-04-01 19:31 | Ondrej Pokorny | Status | resolved => closed |