Comments (4)
creation date = 2009-03-04T08:37:50.153-08:00
I think I've fixed it by moving the DataIsLoaded check to GetNextLang and doing a recursive loop there rather than the iterative approach, but I'm haunted by the feeling this might result in a stack overflow.
from anolis.
creation date: 2009-03-04T10:38:09.033-08:00
Your problem most likely derives from:
ResourceLang lang = GetNextLang();
if( _onlyLoaded ) {
while( !lang.DataIsLoaded ) {
lang = GetNextLang();
if(lang == null) return false;
}
There may be the case where you are using the dot operator on lang when it is null (as GetNextLang may return null). Either go for a try/catch, or a do/while instead of while/do, something like this:
ResourceLang lang;
if (_onlyLoaded) do
{
lang = GetNextLang();
if (lang == null) return false;
}
while (!lang.DataIsLoaded);
This is the safe way of doing it, as while condition doesn't get evaluated if there's no language
from anolis.
creation date = 2009-03-04T12:37:19.763-08:00
Thanks dexter, that was the problem.
Disregard my earlier comment at 16:37 today, my recursive approach was buggy and I've since independently came to the same solution as you to use a do/while but I didn't use the guard expression like that. This is my solution:
ResourceLang lang;
do {
lang = GetNextLang();
if( lang == null ) return false; // lang will be null when all the langs have been iterated through
} while( _onlyLoaded && !lang.DataIsLoaded );
_currentData = lang.Data; // this may lazy-load the data
return true;
It will be included in the next check-in.
from anolis.
closed date = 2009-03-14T17:42:28.823-07:00
from anolis.
Related Issues (20)
- Image centering is buggy HOT 2
- x64 Control may not support transparent background colors HOT 4
- Worker thread does not stop if tree selection changes HOT 1
- RawViewer.RenderResource creates lag with large arrays HOT 1
- Rename Anolis.Gui, build "blind mode", and improve Icon resource handling HOT 1
- Serious GDI+ Handle Leakage HOT 1
- Tree view contents duplicated on save HOT 1
- Use Finalizers HOT 1
- 'Back' button error: "The file "" does not exist" HOT 2
- Restart bug HOT 1
- MSStyles editing at the level of Ave's Vista Style builder (a little side thing; improvement/ feature suggestion) HOT 1
- Fix wizard scaling HOT 1
- crash when changing size of toolbar icons HOT 2
- Add RES/RC Support HOT 2
- ResourceListView - Threading issues again HOT 1
- Damage mitigation HOT 1
- Issue when replacing bitmaps in explorer.exe (Win7 rtm x64)
- Version resource not handled properly
- Feature Request: Batch Import
- Download filename should contain "anolis"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anolis.