<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Facepunch.Steamworks.Interop;

namespace Facepunch.Steamworks
{
    public class BaseSteamworks : IDisposable
    {
        /// <summary>
        /// Current running program's AppId
        /// </summary>
        public uint AppId { get; internal set; }

        public Networking Networking { get; internal set; }
        public Inventory Inventory { get; internal set; }
        public Workshop Workshop { get; internal set; }

        public virtual void Dispose()
        {
            foreach ( var d in Disposables )
            {
                d.Dispose();
            }
            Disposables.Clear();

            Workshop.Dispose();
            Workshop = null;

            Inventory.Dispose();
            Inventory = null;

            Networking.Dispose();
            Networking = null;

            if ( native != null )
            {
                native.Dispose();
                native = null;
            }
        }<commit_msg>Null ref checks on dispose<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Facepunch.Steamworks.Interop;

namespace Facepunch.Steamworks
{
    public class BaseSteamworks : IDisposable
    {
        /// <summary>
        /// Current running program's AppId
        /// </summary>
        public uint AppId { get; internal set; }

        public Networking Networking { get; internal set; }
        public Inventory Inventory { get; internal set; }
        public Workshop Workshop { get; internal set; }

        public virtual void Dispose()
        {
            foreach ( var d in Disposables )
            {
                d.Dispose();
            }
            Disposables.Clear();

            if ( Workshop != null )
            {
                Workshop.Dispose();
                Workshop = null;
            }

            if ( Inventory != null )
            {
                Inventory.Dispose();
                Inventory = null;
            }

            if ( Networking != null )
            {
                Networking.Dispose();
                Networking = null;
            }

            if ( native != null )
            {
                native.Dispose();
                native = null;
            }
        }
{'fraction_non_alphanumeric': 0.08913412563667232, 'fraction_numerical': 0.0, 'mean_word_length': 1.345273631840796, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '114783', 'n_tokens_mistral': 611, 'n_tokens_neox': 572, 'n_words': 157}