Benedicht / BestHTTP-Issues

Issue tracking repo for the Best HTTP and all related Unity plugins.
https://assetstore.unity.com/publishers/4137
12 stars 1 forks source link

WebGL Build Compilation Error #197

Closed FlaShG closed 5 months ago

FlaShG commented 5 months ago

Hi,

I've noticed an issue in 3.0.8, in ThreadedLogger.cs, starting at line 70.

        public bool IsEmpty => this.jobs.IsEmpty;
        //...
#if !UNITY_WEBGL || UNITY_EDITOR
        //...
        private ConcurrentQueue<LogJob> jobs = new ConcurrentQueue<LogJob>();
        //...
#endif

This means that the package cannot compile in WebGL builds, as jobs is referenced but not present.

Suggested Fix:

#if !UNITY_WEBGL || UNITY_EDITOR
        //...
        private ConcurrentQueue<LogJob> jobs = new ConcurrentQueue<LogJob>();
        public bool IsEmpty => this.jobs.IsEmpty;
        //...
#else
        public bool IsEmpty => true;
#endif
Benedicht commented 5 months ago

Thank you for your report, it's going to be fixed in the next version.