private void CreateConverter() { if (!_converter.Equals(IntPtr.Zero)) { PechkinStatic.DestroyConverter(_converter); if (_log.IsTraceEnabled) { _log.Trace("T:" + Thread.CurrentThread.Name + " Destroyed previous converter"); } } // the damn lib... we can't reuse anything _globalConfigUnmanaged = _globalConfig.CreateGlobalConfig(); _converter = PechkinStatic.CreateConverter(_globalConfigUnmanaged); if (_log.IsTraceEnabled) { _log.Trace("T:" + Thread.CurrentThread.Name + " Created converter"); } PechkinStatic.SetErrorCallback(_converter, _errorCallback); PechkinStatic.SetWarningCallback(_converter, _warningCallback); PechkinStatic.SetPhaseChangeCallback(_converter, _phaseChangedCallback); PechkinStatic.SetProgressChangeCallback(_converter, _progressChangedCallback); PechkinStatic.SetFinishedCallback(_converter, _finishedCallback); if (_log.IsTraceEnabled) { _log.Trace("T:" + Thread.CurrentThread.Name + " Added callbacks to converter"); } _reinitConverter = false; }
private void CreateConverter() { if (!this._converter.Equals(IntPtr.Zero)) { PechkinStatic.DestroyConverter(this._converter); Tracer.Trace("T:" + Thread.CurrentThread.Name + " Destroyed previous converter"); } // the damn lib... we can't reuse anything this._globalConfigUnmanaged = this._globalConfig.CreateGlobalConfig(); this._converter = PechkinStatic.CreateConverter(this._globalConfigUnmanaged); Tracer.Trace("T:" + Thread.CurrentThread.Name + " Created converter"); PechkinStatic.SetErrorCallback(this._converter, this._onErrorDelegate); PechkinStatic.SetWarningCallback(this._converter, this._onWarningDelegate); PechkinStatic.SetPhaseChangedCallback(this._converter, this._onPhaseChangedDelegate); PechkinStatic.SetProgressChangedCallback(this._converter, this._onProgressChangedDelegate); PechkinStatic.SetFinishedCallback(this._converter, this._onFinishedDelegate); Tracer.Trace("T:" + Thread.CurrentThread.Name + " Added callbacks to converter"); }